Solutions to problems from Cracking The Coding Interview