a short tech quiz on coding
Count the number of pairs from input-list whose difference is K.
Input: N integers, and the value K, which 2 <= N <= 10^5 ; 0 < K < 10^9.
Output : number of pairs whose difference is K.
Example : K=5 array=[1, 5, 7, 2, 2, 7] will return 4 (we count each occurrence)
problem credit by PicCollage
Simply run Pairs.py
Modify input (including list and value K) inside the Pairs.py
I run perfectly both on python 2.7.10, and python 3.5.2.