Cracking the Coding Interview Question 3.7