Company: AT&T
Difficulty: medium
Minimum Moves In a grid-based maze, each cell is either empty (0) or contains an obstacle (1). HackerMan must navigate from cell (0, 0) to cell (n-1, m-1) with a jump parameter k, allowing these moves: Right: (i, j) → (i, j+x) where 1 ≤ x ≤ k Down: (i, j) → (i+x, j) where 1 ≤ x ≤ k Left: (i, j) → (i, j-x) where 1 ≤ x ≤ k Up: (i, j) → (i-x, j) where 1 ≤ x ≤ k For any move, all cells in the path must be obstacle-free and within maze boundaries. Determine the minimum number of moves required to reach the destination, or return -1 if it is impossible. Example Consider n = 2, m = 2, jump parameter k = 2, and maze = [[0, 0], [1, 0]]. The maze looks like this. [[0 0] [1 0]] The following sequence of moves can be performed: (0, 0) → (0, 1) → (1, 1). Hence, HackerMan can reach the end in 2 moves, which is the minimum possible. The answer is 2. Function Description Complete the function getMinimumMoves in the editor with the following paramet