Given an array of integers *nums* and an integer *k*, determine whether there are two distinct indices *i* and *j* such that *nums[i] - nums[j] = k*. Return `true` if such a pair exists, otherwise `false`.
nums = [array of integers], k = integer
boolean (true/false)
Example 1:
Input:
nums = [1,5,3,4,2] k = 3
Output:
true
Explanation:
nums[4] - nums[0] = 2 - 1 = 1 (not 3), but nums[3] - nums[0] = 4 - 1 = 3, so pair exists.
Example 2:
Input:
nums = [8,12,16,4] k = 5
Output:
false
Explanation:
No two elements differ by 5 in this array.