Solutions for Cracking the code interview