Google interview question

Simple dynamic programming and array based questions.