Unofficial C Solution to Problem 2.2 in Cracking the Coding Interview (5th Edition)
In the book, the author introduces many different methods. As the author indicates, the two-pointer iterative solution is the best. In contrast, the recursive method is less effective but quite interesting. It might be useful in some cases. I only … Read More »