As reported: Coupang Bangalore (2025), round 1 coding: after the main question, a second question to explain (approach only, no code): Jump Game I.
This is LeetCode 55 — Jump Game.
You are given an integer array nums. You start at index 0; nums[i] is the maximum jump length from index i (you may jump any distance from 0 to nums[i]). Return true if you can reach the last index, otherwise false.
Example 1
nums = [2,3,1,1,4] -> true
Jump 1 step to index 1, then 3 steps to the last index.
Example 2
nums = [3,2,1,0,4] -> false
Every path reaches index 3, whose jump length is 0.
Constraints: 1 ≤ nums.length ≤ 10^4; 0 ≤ nums[i] ≤ 10^5.
Code runner format: one line holding nums (LeetCode's test-case format). Implement canJump(nums); the harness prints true or false.