Problems > Can You Reach the End > Editorial

Can You Reach the End — Solution & Editorial

Back to the Problem

Sweep once maintaining the furthest reachable index; if the current index ever exceeds it, you are stuck.

Complexity: O(N)