← 返回 meta 的题目列表Debugging Maze Application
类型:online_judge
You are tasked with fixing issues in a maze application. This application includes definitions for a maze, a maze printer, and a maze solver. Your tasks are:
Fix the maze printer issue: When printing the maze, entrance and exit points are represented by *, but should be e and E respectively.
Fix the maze solver issue using BFS: Solve the problem of revisiting nodes by adding each visited position to a set to avoid repetition.
The maze is defined as follows:
The maze is a 2D array containing paths and walls.
The entrance point is marked as e, and the exit point is marked as E.
Walls are marked as #, and paths as spaces.
Test case:
Input:
#####
#e #
# #E#
#####
Expected Output:
#####
#e #
# #E#
#####
Develop Python code to meet these requirements.
Example
Input
#####
#e #
# #E#
#####