Minimum Moves

Problem Overview

  • Determine the minimum moves to reach (n-1, m-1) from (0,0) in an n x m grid, moving up/down/left/right up to k cells per move through clear cells only.
  • Input: maze matrix of 0s/1s and integer k; Output: minimum moves, or -1 if unreachable.
  • Constraints: 1 ≤ n,m ≤ 100; 1 ≤ k ≤ 100.
  • Real-world context: maze navigation in HackerPlay (grid pathfinding domain).
  • Asked in Goldman interviews; a classic coding interview problem and interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: