Pregunta de entrevista de Block

2D dynamic programming style chess question