aboutsummaryrefslogtreecommitdiff
path: root/challenge-252/deadmarshal/python/ch2.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-252/deadmarshal/python/ch2.py')
-rw-r--r--challenge-252/deadmarshal/python/ch2.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-252/deadmarshal/python/ch2.py b/challenge-252/deadmarshal/python/ch2.py
new file mode 100644
index 0000000000..17868430ab
--- /dev/null
+++ b/challenge-252/deadmarshal/python/ch2.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+
+def unique_sum_zero(n):
+ ret = []
+ for i in range(1,n//2+1):
+ ret += [i,-i]
+ if n % 2 != 0: ret.append(0)
+ return ret
+
+print(unique_sum_zero(5))
+print(unique_sum_zero(3))
+print(unique_sum_zero(1))