Python, Maze, Shortest, Path.
neighboring cells for dx, dy in [(0, 1), (0, -1), (1, 0), (-1, 0)]: new_x, new_y = x + dx, y + dy if 0 <= new_x < maze.shape[0] and 0 <= new_y < maze.shape[1] and maze[new_x, new_y] == 0 and (new_x, new_y) not in visited: queue.append((new_x, new_y)) visited.add((new_x, new_y)) return False # Find