<p>Given an array of integers <code>arr</code>, return <code>true</code> <em>if the number of occurrences of each value in the array is <strong>unique</strong> or </em><code>false</code><em> otherwise</em>.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

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

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> arr = [1,2]
<strong>Output:</strong> false
</pre>

<p><strong class="example">Example 3:</strong></p>

<pre>
<strong>Input:</strong> arr = [-3,0,1,-3,1,1,1,-3,10,0]
<strong>Output:</strong> true
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= arr.length &lt;= 1000</code></li>
	<li><code>-1000 &lt;= arr[i] &lt;= 1000</code></li>
</ul>

class Solution {
public:
    bool uniqueOccurrences(vector<int>& arr) {
        sort(arr.begin(),arr.end());
        int ans[70];
        int k=0;
        for(int i=1;i<arr.size();i++)
        {
            int j=1;
            while(arr[i]==arr[i-1]&&i<arr.size()-1)
            {
               
                i++;
            
                j++;
                
            }
            if(arr[i]==arr[i-1]&&i==arr.size()-1)
            {
                j++;
            }
            else if(i==arr.size()-1){
                ans[k]=j;
                k++;
                j=1;
            }
            ans[k]=j;
            
            for(int o=0;o<k;o++)
            {
                if(ans[o]==ans[k])
                {
                    return false;
                }
            }
            k++;

        }
        return true;
        
    }
};
10500