Pregunta de entrevista de Amazon

basic 2d dp question same as leetcode