Differing pairs

Given an array of unique randomly sorted integers and a number kk it is required to find the count of the unordered pairs in the array that have a difference of kk. In the text file, how many unorederd pairs of numbers have a difference of 70.

Details and Assumptions

As an example in the array [2, 8, 4, 3, 1] with k=2k=2 is 22....(2,4) and (3,1).

×

Problem Loading...

Note Loading...

Set Loading...