InterviewDB
Question
·
USA
Grid Jump - Minimum Steps to Traverse a Matrix with Jump Rules
Onsite
Question Details
Problem You are given an m x n grid of integers. Starting at cell (0, 0), reach cell (m-1, n-1) in the minimum number of jumps. From cell (r, c) with value v, you can jump to any cell (r', c') where |r'-r| + |c'-c| <= v and grid[r'][c'] != -1 (blocked). Return the minimum number of jumps, or -1 if unreachable. Example: Approach BFS from (0,0). For each cell at distance d, enqueue all reachable neighbors not yet visited. BFS guarantees minimum jumps. Follow-ups What is the time complexity? How do…
Full Details
🔒
Unlock all C3 AI questions
Full insider details, leaked discussions, and candidate experiences.
or every company, $100/year →About This Question
This is a reported interview question from a c3 ai interview during the onsite round.
It covers the following topics: Coding, Graph, Onsite, Matrix .