Problem · Graph
Minimum Grid Moves
Learn this problemProblem statement
In a zero-and-one maze, move from the top-left cell to the bottom-right. A move travels between 1 and k cells horizontally or vertically, but it cannot cross or land on an obstacle. Return the minimum number of moves, or -1 if the destination is unreachable.
Function
getMinimumMoves(maze: int[][], k: int) → intExamples
Example 1
maze = [[0,0],[1,0]]k = 2return = 2Move right once and down once; the obstacle blocks the other route.
Constraints
1 <= rows, columns, k <= 100- Cells contain only
0or1.
More Atlassian problems
- Planning ProductionOA · Seen Feb 2025
- K-Means ClusteringOA · Seen Feb 2025
- Minimum Sorted Erasure OperationsOA · Seen Jun 2024
- Count Analogous ArraysOA · Seen Mar 2024
- Get Maximum ScoreOA · Seen Mar 2024
- Better Compression 🦀OA · Seen Mar 2024
- Romanizer 🐡OA · Seen Mar 2024
- Flower Bouquets 💐OA · Seen Mar 2024