Given an array of integers nums and an integer k, return the nums[i], nums[j]), where i j num.length.
The distance between a pair of integers,
and , is defined as the absolute difference between them.
Constraints:
nums.length
nums[i]
k
Note: Given an array of size
, the total number of possible pairs is given by . As evaluates to , there are exactly these much possible -distances.
Given an array of integers nums and an integer k, return the nums[i], nums[j]), where i j num.length.
The distance between a pair of integers,
and , is defined as the absolute difference between them.
Constraints:
nums.length
nums[i]
k
Note: Given an array of size
, the total number of possible pairs is given by . As evaluates to , there are exactly these much possible -distances.