Given an array of integers arr, return true if the number of occurrences of each value in the array is unique, or false otherwise.

&nbsp;
Example 1:

Input: arr = [1,2,2,1,1,3]
Output: true
Explanation:&nbsp;The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two values have the same number of occurrences.

Example 2:

Input: arr = [1,2]
Output: false


Example 3:

Input: arr = [-3,0,1,-3,1,1,1,-3,10,0]
Output: true


&nbsp;
Constraints:


	1 &lt;= arr.length&nbsp;&lt;= 1000
	-1000 &lt;= arr[i] &lt;= 1000


class Solution:
    def uniqueOccurrences(self, arr: List[int]) -> bool:
		# defining dictionary
        occ = dict()
        
		# adding elements with their counts in dictionary
        for element in arr:
            if element not in occ:
                occ[element] = 0
            else:
                occ[element] += 1
        
		# list of count of elements
        values = list(occ.values())
		# Unique count
        unique = set(values)
        
        if len(values) == len(unique):
            return True
        else:
            return False
class Solution {
    public boolean uniqueOccurrences(int[] arr) {
        Arrays.sort(arr);
        HashSet<Integer> set = new HashSet<>();

        int c = 1;
        for(int i = 1; i < arr.length; i++)
        {
            if(arr[i] == arr[i-1]) c++;

            else
            {
                if(set.contains(c)) return false;

                set.add(c);

                c = 1;
            }
        }

        if(set.contains(c)) return false;

        return true;
    }
}
class Solution {
public:
    bool uniqueOccurrences(vector<int>& arr) {
        unordered_map<int,int>sk;
        unordered_map<int,int>skk;
        for(int i=0;i<arr.size();i++){
            sk[arr[i]]++;
        }
         for(auto j : sk)
        {
            if(skk[j.second]==1){
                return false;
            }
            skk[j.second]++;
        }

        return true;
    }
};
var uniqueOccurrences = function(arr) {
    const obj = {};
//     Creating hashmap to store count of each number
    arr.forEach(val => obj[val] = (obj[val] || 0) + 1);
//     Creating an array of the count times
    const val = Object.values(obj).sort((a, b) => a-b);
//     Now, just finding the duplicates
    for(let i = 0; i<val.length-1; i++){
        if(val[i]===val[i+1]) return false;
    }
    return true;
};
Unique Number of Occurrences