The advanced challenge is implementing your algorithm with O(1) space complexity.
My S(1) algorithm is converting the iterative algorithm (stack) to recursive algorithm.
The recursive one transfers to memory overhead to function call stack though it seemingly cuts the extra space in the function.
So I solve this problem with a trivial S(n) = O(n) algorithm.