import java.util.*
class Solution {
fun uniqueOccurrences(arr: IntArray): Boolean {
//numCount<arr에 나타난 숫자, arr에 나타난 횟수>
var numCount = mutableMapOf<Int,Int>()
for(num in arr){
if(numCount.containsKey(num)){
numCount[num] = numCount[num]!! + 1
}
else{
numCount[num] = 1
}
}
//숫자가 arr에 나타난 횟수가 unique한지 확인
var numCountSet = mutableSetOf<Int>()
for((num, count) in numCount){
println("$num, $count")
if (numCountSet.contains(count)) return false
else numCountSet.add(count)
}
return true
}
}