Matrix Land (Dynamic Programming)

pls help me with the code of question : https://www.hackerrank.com/challenges/matrix-land/problem?isFullScreen=true&h_r=next-challenge&h_v=zen