@@ -0,0 +1,666 @@
+package leetcode;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A/**%0A * https://leetcode.com/problems/single-number-ii/%0A */%0Apublic class Problem137 %7B%0A    public int singleNumber(int%5B%5D A) %7B%0A        Map%3CInteger, Integer%3E map = new HashMap%3C%3E();%0A        for (int i = 0; i %3C A.length; i++) %7B%0A            if (!map.containsKey(A%5Bi%5D)) %7B%0A                map.put(A%5Bi%5D, 1);%0A            %7D else %7B%0A                map.put(A%5Bi%5D, map.get(A%5Bi%5D) + 1);%0A            %7D%0A        %7D%0A        for (Map.Entry%3CInteger, Integer%3E e : map.entrySet()) %7B%0A            if (e.getValue() != 3) %7B%0A                return e.getKey();%0A            %7D%0A        %7D%0A        throw new RuntimeException();%0A    %7D%0A%7D%0A

Solve problem 137 (using O(n) space)