1748. Sum of Unique Elements

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1748

class Solution:
    def sumOfUnique(self, nums: List[int]) -> int:
        cnt = Counter(nums)
        return sum(x for x, v in cnt.items() if v == 1)