Google Interview Question

q1- dynamic programing question aa