Odd Even Jump
You are given an integer array arr. From some starting index, you can make a series of jumps. The first jump is odd, the second is even, and so on. From index i, during odd jumps you can jump to j where arr[j] is the smallest value >= arr[i] with j > i. During even jumps, jump to j where arr[j] is the largest value <= arr[i] with j > i. Return the number of good starting indices.
Odd Even Jump

You are given an integer array arr. From some starting index, you can make a series of jumps. The first jump is odd, the second is even, and so on. From index i, during odd jumps you can jump to j where arr[j] is the smallest value >= arr[i] with j > i. During even jumps, jump to j where arr[j] is the largest value <= arr[i] with j > i. Return the number of good starting indices.

Example 1:
Input: {"arr":[10,13,12,14,15]}
Output: 2
Input
arr ={"arr":[10,13,12,14,15]}

Array: [10, 13, 12, 14, 15], n=5

State
arr
[10, 13, 12, 14, 15]
n
5
Variables
No variables to display
DepthFunction Call
Stack empty
0/1