i) Given an array with duplicate values, find the number of pairs that have a difference equal to
a given integer number. The array can contain duplicate values. The input consists of a number
‘N’ giving the size of the array and a number ‘D’ which gives the difference. The next line
consists of N space separated integers.
Input : 7 6
2 3 3 5 9 15 15
Output : 4
Explanation : The pairs are {3,9},{3,9},{9,15},{9,15} = 4