Cracking the Coding Interview solution by Bharath Ramesh