Google interview question

Trees, and Dynamic Programming