Solution for the two sum problem, how many distinct pairs of numbers in given list have sum values in a given range