J.P. Morgan interview question

A recursion problem on 2-dimensional grid(matrix) traversal.