Minimum Steps to Reach a Target with Variable Jumps

Asked atGoldman SachsZeta
1Give yourself 5 minutes
2Answer out loud, not in your head
3Then compare with the answer below
0
Stuck? Show a way to structure it+
  1. 01Track current jump boundary and farthest reachable index
  2. 02Scan positions within the boundary
  3. 03Extend farthest using i plus jump
  4. 04Commit a jump at boundary
  5. 05Return failure if the frontier stalls

Reference answer

Then expect these follow-ups

  • How does this differ from Jump Game I?

    Tests: follow-up reasoning

  • Can you reconstruct actual landing indices?

    Tests: implementation extension

Hiring now

Zeta has 97 open roles right now

landed applies to roles like these for you, on each company’s own site, with answers written for the role.

Get 5x interviews10 free auto-applies. No card.
  • Senior Software Engineer

    New York, NY

  • Lead Software Engineer

    Bangalore, India

  • Senior Analyst, Analytics & Insights - Programmatic

    Bangalore, India

Or practice this question first

Next question