Jump Game
Decide whether you can reach the last index.
Pattern fit
A single farthest-reachable boundary is enough, which makes the problem a perfect example of a greedy invariant instead of DP.
Key observation
As long as your index stays within the current farthest reach, you can extend that reach using nums[i].
Target complexity
O(n) / O(1)
How to break down the solution cleanly
A single farthest-reachable boundary is enough, which makes the problem a perfect example of a greedy invariant instead of DP.
As long as your index stays within the current farthest reach, you can extend that reach using nums[i].
Identify the local choice that seems to preserve the most future flexibility.
Sort or preprocess if that makes the choice testable.
Reference implementation
Python# Generic pattern template
items.sort(key=priority)
answer = 0
for item in items:
if can_take(item):
take(item)
answer = update(answer)
Common pitfalls
Stopping after one bad zero without checking whether it was already bypassed.
Confusing minimum jumps with simple reachability.
Common follow-ups
Why is maintaining the farthest reach sufficient?
How does this relate to Jump Game II?
Continue with related problems
Build repeatable depth inside the Greedy cluster before moving on.