Design and implement a TwoSum class. It should support the following operations: add and find.
add - Add the number to an internal data structure.
find - Find if there exists any pair of numbers which sum is equal to the value.
For example,
解法1:
要注意一些细节。需要排除找到的数字不是自己,所以要统计每一个数字出现的次数。
C++
Java