Amazon interview question

Recursion to iterate a grid