Create countPairsWithADiff