Sum of Unique Elements

给一个数组, 求里面所有只出现一次的数字的和.

class Solution {
    public int sumOfUnique(int[] nums) {
        int[] count = new int[101];
        for(int n : nums){
            count[n]++;
        }
        int res = 0;
        for(int i = 0; i < 101; i++) {
            if(count[i] == 1)
                res += i;
        }
        return res;
    }
}