Jump Game
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position. Return true if you can reach the last index, or false otherwise.

30:00

Jump Game
medium
Topics
Companies

You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position. Return true if you can reach the last index, or false otherwise.

Example 1:
Input: [2,3,1,1,4]
Output: true
Constraints:
  • 1nums.length1041 \leq \text{nums.length} \leq 10^4

  • 0nums[i]1050 \leq \text{nums}[i] \leq 10^5

Input
arr =[2,3,1,1,4]

2

3

1

1

4

i
Goal Index
4
Variables
No variables to display
DepthFunction Call
Stack empty
0/16