Pregunta de entrevista de Google

Simple dynamic programming and array based questions.