Determine whether every distinct value in an array occurs a unique number of times.
Given an integer array, count how many times each distinct value appears. Return whether all occurrence counts are different from one another.
In other words, no two distinct values should have the same frequency in the array.
arr.true if the frequency of every distinct value is unique.false.Example 1
Input
arr = [1,2,2,1,1,3]
Output
true
Explanation
Frequencies are 1→3, 2→2, and 3→1. All counts are distinct.
Example 2
Input
arr = [1,2]
Output
false
Explanation
Both 1 and 2 appear once, so the frequency 1 is repeated.
Example 3
Input
arr = [-3,0,1,-3,1,1,1,-3,10,0]
Output
true
Explanation
Frequencies are -3→3, 0→2, 1→4, and 10→1. No two values share the same count.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.