the number 2 on the first position means you can choose to jump 1 or 2 steps forward, so we can jump 1 step to "8" and then to the last index as yumin829928 mentioned. The expected result is true for this case.

You should indicate in title that this solution uses shortcuts to behave better on in case there's a huge jump ahead ([1000000, 0 x 999999]) or when it's not reachable at all [1, 0 x 1000000] unlike other O(n) solution I've checked.