Answer: Zomato OA Question 2024 June | Greedy | on-campus

Answer · Posted Jun 2026

Solution: Jump Game — Greedy Maximum Reach Approach We use a Greedy approach. Instead of simulating every possible jump combination, we track the farthest index we can reach at any point in time. Maintain a variable maxReach representing the farthest index reachable so far. At each index i, if i > maxReach, we are stuck — return false. Otherwise, update maxReach = max(maxReach, i + nums[i]). If we successfully iterate through all indices without getting stuck, return true. Algorithm Walkthrough ...

The full answer & interview discussion are available to premium members.

Log in Create a free account