Implement a solver of 2D Maze