aboutsummaryrefslogtreecommitdiff
path: root/challenge-228/conor-hoekstra/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-228/conor-hoekstra/python/ch-1.py')
-rw-r--r--challenge-228/conor-hoekstra/python/ch-1.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/challenge-228/conor-hoekstra/python/ch-1.py b/challenge-228/conor-hoekstra/python/ch-1.py
new file mode 100644
index 0000000000..28b58a09e6
--- /dev/null
+++ b/challenge-228/conor-hoekstra/python/ch-1.py
@@ -0,0 +1,7 @@
+def unique_sum(nums):
+ return sum(k for k,v in Counter(nums).items() if v == 1)
+
+# Tests
+unique_sum([2,1,3,2]) # 4
+unique_sum([1,1,1,1]) # 0
+unique_sum([2,1,3,4]) # 10