Assume add heavy

- Use dict(number:count) instead of raw number list to avoid too many repetitive numbers.
- Different from
- Two Sum (https://leetcode.com/problems/two-sum/) where numbers are stored in a list

We store numbers in a dict, access time is O(1).

- Two Sum (https://leetcode.com/problems/two-sum/) where numbers are stored in a list

'''

class TwoSum(object):

```
def __init__(self):
"""
initialize your data structure here
"""
self.number_count = dict()
def add(self, number):
"""
Add the number to an internal data structure.
:rtype: nothing
"""
number_count = self.number_count
number_count[number] = number_count.get(number, 0) + 1
def find(self, value):
"""
Find if there exists any pair of numbers which sum is equal to the value.
:type value: int
:rtype: bool
"""
number_count = self.number_count
for number, count in number_count.iteritems():
other_number = value - number
if other_number == number:
if number_count[number] > 1:
return True
else:
if other_number in number_count:
return True
return False
```

'''