mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-25 20:21:47 +08:00
规范格式
This commit is contained in:
@ -0,0 +1,16 @@
|
||||
package leetcode
|
||||
|
||||
func uniqueOccurrences(arr []int) bool {
|
||||
freq, m := map[int]int{}, map[int]bool{}
|
||||
for _, v := range arr {
|
||||
freq[v]++
|
||||
}
|
||||
for _, v := range freq {
|
||||
if _, ok := m[v]; !ok {
|
||||
m[v] = true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
Reference in New Issue
Block a user