```
class TwoSum {
public:
/** Initialize your data structure here. */
TwoSum()
{
}
/** Add the number to an internal data structure.. */
void add(int number)
{
data[number]++;
}
/** Find if there exists any pair of numbers which sum is equal to the value. */
bool find(int value)
{
for(auto it:data)
if(data.count(value-it.first)&&(data[value-it.first]>1||value-it.first!=it.first))
return true;
return false;
}
map<int,int> data;
};
```