Skip to content

LC 1748 [E] Sum of Unique Elements

Code with Senpai edited this page May 31, 2022 · 1 revision
class Solution:
    def sumOfUnique(self, A):
        return sum(a for a, c in collections.Counter(A).items() if c == 1)
Clone this wiki locally