Find the number of pairs that an array has that add up to a given sum