Product
Pricing
Blog
Forum
NEW
Referral
Description
Solution
Discussion
Submissions
Ask AI
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
Report
Report seen similar question in interview
Accepted
14
/66
Acceptance Rate
21.2%
Ask AI Assistant
Ask AI Assistant
Ask me anything about this coding question!
Python3
Auto
Debug
Run
Submit
Test Cases
Input
nums =
index =
x =
Output
Expected