Available question text
Given a maze where a ball rolls in a chosen direction until it hits a wall or drops into a hole, find the shortest-distance path (measured by number of cells rolled) from a start to the hole and, if multiple shortest paths exist, return the lexicographically smallest sequence of move directions; return "impossible" if unreachable. This requires treating each roll as a weighted move and resolving ties by lexicographic order of the move string.
Related questions
Continue with questions that share topics or the same question type.
- Alternating Groups III
Coding
- Basic Calculator III
Coding · Math · Recursion · Stack
- Best Time to Buy and Sell Stock III
Coding
- Combination Sum III
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 499. The Maze III
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source