2023-12-09 18:42:21 +08:00
< 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 >
2022-03-27 20:37:52 +08:00
< p > < / p >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 1:< / strong > < / p >
2022-03-27 20:37:52 +08:00
< pre >
< strong > Input:< / strong > arr = [1,2,2,1,1,3]
< strong > Output:< / strong > true
< strong > Explanation:< / strong > The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two values have the same number of occurrences.< / pre >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 2:< / strong > < / p >
2022-03-27 20:37:52 +08:00
< pre >
< strong > Input:< / strong > arr = [1,2]
< strong > Output:< / strong > false
< / pre >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 3:< / strong > < / p >
2022-03-27 20:37:52 +08:00
< pre >
< strong > Input:< / strong > arr = [-3,0,1,-3,1,1,1,-3,10,0]
< strong > Output:< / strong > true
< / pre >
< p > < / p >
< p > < strong > Constraints:< / strong > < / p >
< ul >
2023-12-09 18:42:21 +08:00
< li > < code > 1 < = arr.length < = 1000< / code > < / li >
2022-03-27 20:37:52 +08:00
< li > < code > -1000 < = arr[i] < = 1000< / code > < / li >
< / ul >