You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are given an M by N matrix consisting of booleans that represents a board. Each True boolean represents a wall. Each False boolean represents a tile you can walk on.
Given this matrix, a start coordinate, and an end coordinate, return the minimum number of steps required to reach the end coordinate from the start. If there is no possible path, then return null. You can move up, left, down, and right. You cannot move through walls. You cannot wrap around the edges of the board.
and start = (3, 0) (bottom left) and end = (0, 0) (top left), the minimum number of steps required to reach the end is 7, since we would need to go through (1, 2) because there is a wall everywhere else on the second row.
The text was updated successfully, but these errors were encountered:
You are given an
M
byN
matrix consisting of booleans that represents a board. EachTrue
boolean represents a wall. Each False boolean represents a tile you can walk on.Given this matrix, a start coordinate, and an end coordinate, return the minimum number of steps required to reach the end coordinate from the start. If there is no possible path, then return
null
. You can move up, left, down, and right. You cannot move through walls. You cannot wrap around the edges of the board.For example, given the following board:
and
start = (3, 0) (bottom left)
andend = (0, 0) (top left)
, the minimum number of steps required to reach the end is7
, since we would need to go through(1, 2)
because there is a wall everywhere else on the second row.The text was updated successfully, but these errors were encountered: