Solutions for problems in Book - Cracking the Coding Interview