Greedy: track the furthest reachable index.
Scan left to right.
If i > far, you're stuck.
Update far = max(far, i + nums[i]).
Greedy: track the furthest reachable index.
Scan left to right.
If i > far, you're stuck.
Update far = max(far, i + nums[i]).