First implementation, recursion
First implementation, use two pointers