package leetcode;

/**
 * https://leetcode.com/problems/unique-number-of-occurrences/
 */
public class Problem1207 {
    public boolean uniqueOccurrences(int[] arr) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem1207 prob = new Problem1207();
        System.out.println(prob.uniqueOccurrences(new int[]{1, 2, 2, 1, 1, 3})); // true
        System.out.println(prob.uniqueOccurrences(new int[]{1, 2})); // false
        System.out.println(prob.uniqueOccurrences(new int[]{-3, 0, 1, -3, 1, 1, 1, -3, 10, 0})); // true
    }
}

@@ -12,16 +12,113 @@
 tcode;%0A%0A
+import java.util.HashMap;%0Aimport java.util.HashSet;%0Aimport java.util.Map;%0Aimport java.util.Set;%0A%0A
 /**%0A * h
@@ -269,407 +269,473 @@
     
-// TODO%0A        return false;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1207 prob = new Problem1207();%0A        System.out.println(prob.uniqueOccurrences(new int%5B%5D%7B1, 2, 2, 1, 1, 3%7D)); // true%0A        System.out.println(prob.uniqueOccurrences(new int%5B%5D%7B1, 2%7D)); // false%0A        System.out.println(prob.uniqueOccurrences(new int%5B%5D%7B-3, 0, 1, -3, 1, 1, 1, -3, 10, 0%7D)); //
+Map%3CInteger, Integer%3E map = new HashMap%3C%3E();%0A        for (int i = 0; i %3C arr.length; i++) %7B%0A            if (!map.containsKey(arr%5Bi%5D)) %7B%0A                map.put(arr%5Bi%5D, 0);%0A            %7D else %7B%0A                map.put(arr%5Bi%5D, map.get(arr%5Bi%5D) + 1);%0A            %7D%0A        %7D%0A        Set%3CInteger%3E set = new HashSet%3C%3E();%0A        for (int count : map.values()) %7B%0A            if (!set.add(count)) %7B%0A                return false;%0A            %7D%0A        %7D%0A        return
  true
+;
 %0A   

Solve problem 1207