https://leetcode.com/problems/sum-of-unique-elements/description/ Easy

Решение

class Solution {
    fun sumOfUnique(nums: IntArray): Int {
        val cnt = IntArray(101)
        for (v in nums) cnt[v]++
        var ans = 0
        var i = 1
        while (i <= 100) {
            if (cnt[i] == 1) ans += i
            i++
        }
        return ans
    }
}