My LeetCode grinding. Trying to do a problem a day.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

problem.txt 504B

123456789101112131415161718192021222324252627
  1. Given an array of integers arr, write a function that returns true if and only if the number of occurrences of each value in the array is unique.
  2. Example 1:
  3. Input: arr = [1,2,2,1,1,3]
  4. Output: true
  5. Explanation: The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two values have the same number of occurrences.
  6. Example 2:
  7. Input: arr = [1,2]
  8. Output: false
  9. Example 3:
  10. Input: arr = [-3,0,1,-3,1,1,1,-3,10,0]
  11. Output: true
  12. Constraints:
  13. 1 <= arr.length <= 1000
  14. -1000 <= arr[i] <= 1000