Available question text
Count how many starting indices can reach the end of an array by alternating odd/even jumps where an odd jump goes to the smallest-index j>i with arr[j] >= arr[i] and an even jump goes to the smallest-index j>i with arr[j] <= arr[i]. The core challenge is efficiently precomputing these next-higher/next-lower targets (e.g., via sorting + monotonic stack or an ordered map) and using DP to track which indices can reach the end.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Google
Leetcode 975. Odd Even Jump
Reported Nov 5, 2024 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source