Given an array
nums and integers indexDiff, valueDiff. Return true if there exist two distinct indices i and j such that |i - j| <= indexDiff and |nums[i] - nums[j]| <= valueDiff.Example 1
Input: nums = [1,2,3,1], indexDiff = 3, valueDiff = 0
Output: true
Explanation: Indices 0 and 3, same values.
Output: true
Explanation: Indices 0 and 3, same values.
Example 2
Input: nums = [1,5,9,1,5,9], indexDiff = 2, valueDiff = 3
Output: false
Explanation: No valid pair within the window.
Output: false
Explanation: No valid pair within the window.