Pergunta de entrevista da empresa Block

2D dynamic programming style chess question