Google interview question

Dynamic programming question and Dictionary questions.