Solutions to exercises from Cracking the Coding Interview, 5th Edition