Amazon interview question

Maze with DFS find time complexity