Solutions of the programming questions in Cracking the Coding Interview