The Maze

Given an m × n maze where:

  • 0 represents an empty space;
  • 1 represents a wall;
  • a ball can roll up, down, left, or right;
  • once it starts rolling in a direction, it keeps moving until it hi...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: