Given an array of integers arr, return true if the number of times each distinct value appears is different from the number of times every other distinct value appears, and false otherwise.
Given an array of integers arr, return true if the number of times each distinct value appears is different from the number of times every other distinct value appears, and false otherwise.
Example 1:
Input: {"arr":[1,2,2,1,1,3]}
Output: true
Constraints:
1≤arr.length≤1000
−1000≤arr[i]≤1000
Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result
Run code to see results.
Input
arr ={"arr":[1,2,2,1,1,3]}
arr (6)
1
2
2
1
1
3
count map (value: times seen)
empty
Phase 1: count how many times each value appears. Start with an empty tally for 6 elements.