Browse Curriculum
FAANGPrep Sprint
Medium

Jump Game

Determine if you can reach the last index.

Problem Understanding

You are given an array nums. nums[i] is the maximum jump length from that position. Return true if you can reach the last index.

Strategy

We can track the maximum reachable index.

  1. Init reachable = 0.
  2. Iterate i from 0 to nums.length - 1.
  3. If i > reachable, we are stuck! Return false.
  4. Update reachable = max(reachable, i + nums[i]).
  5. If reachable >= last_index, return true.

Interactive Visualization

Step 1 / 1

Initializing...

1x

Track the 'Max Reachable' index. As long as i <= reachable, we can proceed.

Stop Guessing, Start Mastering.

Build the FAANG intuition. Master this pattern with optimized implementations, visual dry runs, and our curated collection of high-yield problems.