Algorithm · Square · Medium
You are given a binary grid matrix where 0 represents a wall and 1 represents an open cell, along with a starting position entrance specified as [row, col]. The starting cell is always an open space. From any open cell, you can move to adjacent open cells in the four cardinal directions (up, down, left, right). A cell qualifies as an exit if it contains a 1 and sits on the outer boundary of the grid—meaning its row is the first or last row, or its column is the first or last…
Checking your access…