I use HashMap to store times of number be added.

When find be called, we iterate the keys of HashMap, then find another number minus by value.

Then combine the detections together.

Java:

```
public class TwoSum {
private HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
public void add(int number) {
map.put(number, map.containsKey(number) ? map.get(number) + 1 : 1);
}
public boolean find(int value) {
for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
int i = entry.getKey();
int j = value - i;
if ((i == j && entry.getValue() > 1) || (i != j && map.containsKey(j))) {
return true;
}
}
return false;
}
}
```

C++:

```
class TwoSum {
unordered_map<int,int> map;
public:
void add(int number) {
map[number]++;
}
bool find(int value) {
for (unordered_map<int,int>::iterator it = map.begin(); it != map.end(); it++) {
int i = it->first;
int j = value - i;
if ((i == j && it->second > 1) || (i != j && map.find(j) != map.end())) {
return true;
}
}
return false;
}
};
```

Python:

```
class TwoSum:
# initialize your data structure here
def __init__(self):
self.table = dict()
# @return nothing
def add(self, number):
self.table[number] = self.table.get(number, 0) + 1;
# @param value, an integer
# @return a Boolean
def find(self, value):
for i in self.table.keys():
j = value - i
if i == j and self.table.get(i) > 1 or i != j and self.table.get(j, 0) > 0:
return True
return False
```