ByteByteGo logo
menuProblems List

Jump to the End

Medium

You are given an integer array in which you're originally positioned at index 0. Each number in the array represents the maximum jump distance from the current index. Determine if it's possible to reach the end of the array.

Example 1:

Input: nums = [3, 2, 0, 2, 5]
Output: True

Example 2:

Input: nums = [2, 1, 0, 3]
Output: False

Constraints:

  • There is at least one element in nums.
  • All integers in nums are non-negative integers.

You can practice coding exercises online by logging into bytebytego.com on your laptop.