Amazon interview question

Write code to solve a maze