Here is the simple question: Please use recursion to revert 12345 to 54321 And the next question he gave to me is: Can you use operations to solve this problem instead of using string? However, I found there's a problem with running this function. It works when you provide a number like this: But if you provide the number that end with 0, it will cause problem. Because the "Number" cannot start with zero.
Of course there's a way to solve it, but it will be different from what we're looking for from the second question. Not sure if I can figure out a better answer for the second question latter.