This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
import sys | |
# Set recursion limit higher for potentially deep operations, though not strictly | |
# necessary for iterative BFS. Using it to be safe for competitive programming. | |
# sys.setrecursionlimit(2000) | |
def solve(): | |
""" | |
Reads the input, parses the wall layout, and uses a 0-1 BFS |