example if the input is
array size=4
1 1 3 3
d=2(difference)
according to algorithm
i=0
a[i]=1 and a[i+1]=1 both can be paired because difference =0
so we will increment i++ , i=1
now a[i] =1 and a[i+1]=3 difference is 2 so it can be paired
now we do i+=2
i becomes i=3
which will break the condition so we only get one pair but 2 pairs are possible isnt it??
