Solutions to the problems in Cracking the Coding Interview in java and c++