Google interview question

1 DP problem. 1 binary tree question.