You are given a nums, and two integers indexDifference and valueDifference.
Your task is to find two indices i and j such that:
$ ext{abs}(i - j) \geq$ indexDifference
$ ext{abs}( ext{nums}[i] - ext{nums}[j]) \geq$ valueDifference
Return an integer array answer of length answer is
If there are multiple valid pairs of indices, return any of them.
Note:
iandjmay be equal.
Constraints:
n nums.length
nums[i]
indexDifference
valueDifference
You are given a nums, and two integers indexDifference and valueDifference.
Your task is to find two indices i and j such that:
$ ext{abs}(i - j) \geq$ indexDifference
$ ext{abs}( ext{nums}[i] - ext{nums}[j]) \geq$ valueDifference
Return an integer array answer of length answer is
If there are multiple valid pairs of indices, return any of them.
Note:
iandjmay be equal.
Constraints:
n nums.length
nums[i]
indexDifference
valueDifference