Given an integer array nums and an integer k, return the number of index pairs (i, j) such that i j and the absolute difference between nums[i] and nums[j] equals k.
Constraints:
nums.length
nums[i]
k
Given an integer array nums and an integer k, return the number of index pairs (i, j) such that i j and the absolute difference between nums[i] and nums[j] equals k.
Constraints:
nums.length
nums[i]
k