Algorithm · Two Sigma · Medium
You receive a two-dimensional map named grid that models a sewer or pipe network: . indicates a cell that may be traversed. # marks an impassable barrier. S identifies the starting location. T identifies the destination. Travel is allowed only north, south, east, or west; diagonal steps are disallowed, and # cells must not be visited. Decide whether it is possible to get from S to T. Output 1 when a route exists; otherwise, output 0. Input (stdin): The first row contains the…
Checking your access…