Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 588 Bytes

File metadata and controls

19 lines (14 loc) · 588 Bytes

Problem 15: Strategic Leapfrog

Problem Statement

You are given an integer array nums where nums[i] is the maximum length of a jump you can make from that position. You are initially positioned at the first index. Return True if you can reach the last index, or False otherwise.

Input Format

  • An array of integers nums.

Output Format

  • Boolean value.

Constraints

  • 1 <= nums.length <= 10^4
  • 0 <= nums[i] <= 10^5

Example

Input: nums = [2, 3, 1, 1, 4]
Output: True
Explanation: Jump 1 step from index 0 to 1, then 3 steps to the last index.