You are given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such that nums[i] == nums[j] and abs(i - j) <= k, otherwise return false.
Example 1:
Input: nums = [1,2,3,1], k = 3
Output: trueExample 2:
Input: nums = [2,1,2], k = 1
Output: falseConstraints:
1 <= nums.length <= 100,000-1,000,000,000 <= nums[i] <= 1,000,000,0000 <= k <= 100,000