I’m trying to write a function pairSum(data, value), in which if a list “data” contains two distict numbers whose sum equals “value,” the function returns true. I accomplished this using a list but is there a more efficient way I could write this function using dictionaries?
Share
You could try using a set.