Google interview question

they asked some dynamic programming question