Given a source and distance, in a 2d array containing blocks which breaks if we reach adjacent to it twice, return true if there exists a path
Asked in the Code-pair technical stage.
Use four-directional movement. The grid contains 0 for open cells and 1 for blocks. Return whether an open-cell path starting at source has exactly distance moves without being orthogonally adjacent to the same block more than once.
def has_safe_path(grid, source, distance):
def has_safe_path(grid, source, distance):