Pregunta de entrevista de Google

Dynamic programming question with a 2d array