Back to course home
0% completed
Vote For New Content
The Maze (medium)
Problem Statement
There is a ball in a maze with empty spaces (0)
and walls (1)
. The ball can move up
, down
, left
, or right
through empty spaces but won't stop until it hits a wall. When the ball stops, it can change direction.
Given an m x n
maze, the ball's start
position, and the destination
, where start = [start<sub>row</sub>, start<sub>col</sub>] and destination = [destination<sub>row</sub>, destination<sub>col</sub>], return true
if the ball can stop at the destination. If the ball can't stop at the destination, return false
.
.....
.....
.....
Like the course? Get enrolled and start learning!
On this page