Given an integer array, output all the unique pairs that sum up to a specific value k.
So the input:
pair_sum([1,3,2,2],4)
would return 2 pairs:
(1,3)
(2,2)
NOTE: FOR TESTING PURPOSES CHANGE YOUR FUNCTION SO IT OUTPUTS THE NUMBER OF PAIRS
Create your solution in the form:
def pair_sum(arr: List, k: int) -> int:
pass
>>> pair_sum([1,3,2,2],4)
2