"""
Exercise 2: Nearest Exit from Entrance in Maze (LeetCode 1926)

maze has "." (open) and "+" (wall). From entrance [r, c], return the fewest
steps to an exit: an open border cell that is not the entrance (-1 if none).
Unweighted → BFS.
"""

def nearest_exit(maze, entrance):
    # TODO
    return -1


# --- self-check: do not modify below this line ---
a = nearest_exit([["+", "+", ".", "+"], [".", ".", ".", "+"], ["+", "+", "+", "."]], [1, 2])
b = nearest_exit([["+", "+", "+"], [".", ".", "."], ["+", "+", "+"]], [1, 0])
c = nearest_exit([[".", "+"]], [0, 0])
print(a, b, c)
print("PASS" if (a, b, c) == (1, 2, -1) else "FAIL")
