Jump Game I

Intermediate Greedy Techniques DSA practice problem on Onlearn.

Difficulty: medium.

Topics: Given an array where each element represents the maximum number of steps you can jump forward from that element, determine if you can reach the last index starting from the first index., Greedy Algorithm, Arrays, greedy algorithm, graph properties, array traversal, time complexity analysis, Jump Game.

Jump Game Given an array nums where each element represents the maximum number of steps you can jump forward from that position, determine if you can reach the last index starting from the first index. Input Specification An array of non negative integers (0 ≤ nums[i] ≤ 10⁵) Length 1 ≤ nums.length ≤ 10⁴ Output Specification Return true if you can reach the last index, false otherwise Examples Input: nums = [2,3,1,0,4] Output: true Explanation: Jump to index 1 (value 3), then jump to index 4 (last index). Input: nums = [3,2,1,0,4] Output: false Explanation: All paths get stuck at index 3 (value 0), which can't reach the end.