Given an integer array nums and two integers indexDiff and valueDiff, determine if there exist two distinct indices i and j such that:
i j
abs(i - j) indexDiff
abs(nums[i] - nums[j]) valueDiff
Return true if such a pair of indices exists, or false otherwise.
Constraints:
nums.length
nums[i]
indexDiff nums.length
valueDiff
Given an integer array nums and two integers indexDiff and valueDiff, determine if there exist two distinct indices i and j such that:
i j
abs(i - j) indexDiff
abs(nums[i] - nums[j]) valueDiff
Return true if such a pair of indices exists, or false otherwise.
Constraints:
nums.length
nums[i]
indexDiff nums.length
valueDiff