find pairs in array which sums to a particular number