Though it says O(1) space, recursive solution got accepted


#1

Comment body goes here.


#2

Even swapping the data is allowed


#3

The solution using recursion got accepted. Can someone point to this? Isn’t using space from function stack a wrong practice when the problem asks to use constant extra space only?


#4

Yeah it was intended to be solved without using any kind of space (that includes stack space used during recursion).