New
ML System Design & SQL tracks just landed
See what's new
×
Question Bank
Pricing
Blog
Forum
HOT
Referral
Description
Solution
Discussion
Submissions
Ask AI
Question Bank
Coding Question
AI Insights
Quick Summary
Simulate a directional jump sequence on a 1D array where each leap depends on an alternating direction and a target height condition.
Identify the nearest valid landing index in the current direction without scanning the entire array repeatedly.
Return the final index where the traversal halts due to an unmet target or boundary constraint.
What This Tests
Array simulation and mutable state management
Efficient neighbor/value lookups using precomputed mappings
Binary search application on sorted index collections
Algorithmic optimization beyond brute-force traversal
Common Patterns
Simulation
Hashing
Sorting
Binary Search
Collapse
Hint 1
Hint 2
Hint 3
What Interviewers May Ask Next
Accepted
30
/120
Acceptance Rate
25.0%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Qwen
Qwen3.6-Flash
0/2000
Auto
Debug
Run
Submit
Test Cases
Input
nums =
index =
x =
Output
Expected