From 0e17a5e4154054fa1027b955e30892bb7feabedb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C5=9F=C4=B1nsu=20Ar=C4=B1c=C4=B1?= Date: Thu, 13 Jan 2022 20:33:14 +0300 Subject: [PATCH] 1748 --- E_1748_SumOfUniqueElements.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 E_1748_SumOfUniqueElements.py diff --git a/E_1748_SumOfUniqueElements.py b/E_1748_SumOfUniqueElements.py new file mode 100644 index 0000000..9d148c8 --- /dev/null +++ b/E_1748_SumOfUniqueElements.py @@ -0,0 +1,8 @@ +class Solution: + def sumOfUnique(self, nums: List[int]) -> int: + retVal=0 + count=Counter(nums) + for (x,y) in count.items(): + if y==1: + retVal+=x + return retVal \ No newline at end of file