package leetcode;

import java.util.Arrays;

/**
 * https://leetcode.com/problems/single-number-iii/
 */
public class Problem260 {
    public int[] singleNumber(int[] nums) {
        return null;
    }
    
    public static void main(String[] args) {
        Problem260 prob = new Problem260();
        System.out.println(Arrays.toString(prob.singleNumber(new int[]{1, 2, 1, 3, 2, 5}))); // [3, 5]
    }
}

@@ -29,22 +29,45 @@
 va.util.
-Arrays
+HashMap;%0Aimport java.util.Map
 ;%0A%0A/**%0A 
@@ -203,223 +203,493 @@
     
-return null
+Map%3CInteger, Integer%3E map = new HashMap%3C%3E()
 ;%0A    
-%7D%0A
     
-%0A    public static void main(String%5B%5D args) %7B%0A        Problem260 prob = new Problem260();%0A        System.out.println(Arrays.toString(prob.singleNumber(new int%5B%5D%7B1, 2, 1, 3, 2, 5%7D))); // %5B3, 5%5D
+for (int num : nums) %7B%0A            if (map.containsKey(num)) %7B%0A                map.put(num, map.get(num) + 1);%0A            %7D else %7B%0A                map.put(num, 1);%0A            %7D%0A        %7D%0A        int%5B%5D result = new int%5B2%5D;%0A        int i = 0;%0A        for (Map.Entry%3CInteger, Integer%3E e : map.entrySet()) %7B%0A            if (e.getValue() == 1) %7B%0A                result%5Bi++%5D = e.getKey(); %0A            %7D%0A        %7D%0A        return result;
 %0A   

Solve problem 260