Problem. nums[i] is the maximum jump length from index i. Starting at index 0, return whether you can reach the last index.
nums = [2, 3, 1, 1, 4] → True (0 → 1 → 4)
nums = [3, 2, 1, 0, 4] → False (every path gets stuck on the 0 at index 3)
It looks like a search over jump choices, and it is one. But reachability has a special shape: if you can reach index j, you can
reach every index before j too (jump shorter). So the set of reachable indices is always a prefix [0, reach], and the whole
question is how far reach gets.
ML context. The fewest-jumps version (Change A) chooses the fewest keyframes to process in a video: if frame i's features
stay valid for the next nums[i] frames (the scene doesn't change), the fewest frames that cover the whole video is the minimum
number of jumps (Change D). The same "farthest reach" greedy plans checkpoints, cache refreshes and sampled evaluations over a
sequence.