diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2023-08-01 00:30:26 +0100 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2023-08-01 00:30:26 +0100 |
| commit | b7c6ba230d95ffad246f0f9874e82cbd95e12f56 (patch) | |
| tree | c4ba4a2568676aba47a13dba8dcd5ea206366461 /challenge-228/conor-hoekstra/python | |
| parent | b7b0353c40a650fce3847d239aa83c2eb67086ac (diff) | |
| download | perlweeklychallenge-club-b7c6ba230d95ffad246f0f9874e82cbd95e12f56.tar.gz perlweeklychallenge-club-b7c6ba230d95ffad246f0f9874e82cbd95e12f56.tar.bz2 perlweeklychallenge-club-b7c6ba230d95ffad246f0f9874e82cbd95e12f56.zip | |
- Added solutions by Niels van Dijke.
- Added solutions by Ulrich Rieke.
- Added solutions by Robert DiCicco.
- Added solutions by Laurent Rosenfeld.
- Added solutions by Peter Meszaros.
- Added solutions by Mark Anderson.
- Added solutions by Lubos Kolouch.
- Added solutions by Ali Moradi.
- Added solutions by Dave Jacoby.
- Added solutions by Peter Campbell Smith.
- Added solutions by W. Luis Mochan.
- Added solutions by Steven Wilson.
- Added solutions by Thomas Kohler.
- Added solutions by E. Choroba.
- Added solutions by Bob Lied.
Diffstat (limited to 'challenge-228/conor-hoekstra/python')
| -rw-r--r-- | challenge-228/conor-hoekstra/python/ch-1.py | 7 |
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 |
