aboutsummaryrefslogtreecommitdiff
path: root/challenge-252/deadmarshal/python/ch2.py
blob: 17868430abda6d71fc455a5477d421be836de3b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
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))