@@ -0,0 +1,996 @@
+/***%0A * Design and implement a TwoSum class. It should support the following operations: add and find.%0A * %0A * add - Add the number to an internal data structure.%0A * find - Find if there exists any pair of numbers which sum is equal to the value.%0A * %0A * For example,%0A *%0A *   add(1); add(3); add(5);%0A *   find(4) -%3E true%0A *   find(7) -%3E false%0A */%0Apublic class Solution %7B%0A    HashMap%3CInteger, Integer%3E map = new HashMap%3CInteger, Integer%3E();%0A    public void add(int number) %7B%0A        if (map.containsKey(number))%0A            map.put(number, map.get(number) + 1);%0A        else %0A            map.put(number, 1);%0A    %7D%0A%0A    boolean find(int value) %7B%0A        for(Map.Entry%3CInteger, Integer%3E entry:map.entrySet()) %7B%0A            if (!map.containsKey(value - entry.getKey()))%0A                continue;%0A            else %7B%0A                if (value == 2 * entry.getKey() && entry.getValue() == 1)%0A                    continue;%0A                return true;%0A            %7D%0A        %7D%0A        return false;%0A    %7D%0A%7D%0A

add TwoSumIII.java