Reference no: EM132206505
Question :
Write a method two_sum that takes an array as an argument and returns true if the array contains at least one pair of different elements that add up to 0 and returns false otherwise.
Here are some example cases.
[-1, -2, -2, 4] = > false
[1, 2, 3, 4, 0] = > false
[0, 5, 0, -1, 10, 11] = > true
[-4, 5, -6, 7, 4, 3] = > true
[1, 2, -1, -2] = > true