Standard Bar Greedy Approach · Medium O(n) · O(1)
A courier network spans relay posts in a line; each post advertises how many hops forward it can dispatch. A parcel starts at the first post and must reach the final one. The dispatcher tracks the farthest post reachable so far — if the scan ever lands beyond that frontier, the chain is broken and delivery fails.
Input: An integer array nums where nums[i] is the maximum hop length from post i.
Output: Return true if the last post is reachable from the first, false otherwise.
1 <= nums.length <= 10^40 <= nums[i] <= 10^5Input: {"nums":[2,3,1,1,4]}
Output: true
Hop to post 1, then its 3-hop range covers the final post.
Input: {"nums":[3,2,1,0,4]}
Output: false
The zero post strands the parcel — every route dead-ends before index 4.