You are given an integer array arr and an integer d. In a single move, you can jump from your current index i to another index j if all of the following conditions hold:
arr.length
d
arr[i] > arr[j]
arr[i] > arr[k] for every index k strictly between i and j (that is,
You may choose any valid index as your initial starting position.
Return the maximum number of indices you can visit.
Constraints:
arr.length
arr[i]
d arr.length
You are given an integer array arr and an integer d. In a single move, you can jump from your current index i to another index j if all of the following conditions hold:
arr.length
d
arr[i] > arr[j]
arr[i] > arr[k] for every index k strictly between i and j (that is,
You may choose any valid index as your initial starting position.
Return the maximum number of indices you can visit.
Constraints:
arr.length
arr[i]
d arr.length