aboutsummaryrefslogtreecommitdiff
path: root/challenge-252/deadmarshal/python/ch1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-252/deadmarshal/python/ch1.py')
-rw-r--r--challenge-252/deadmarshal/python/ch1.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/challenge-252/deadmarshal/python/ch1.py b/challenge-252/deadmarshal/python/ch1.py
new file mode 100644
index 0000000000..803e722eb5
--- /dev/null
+++ b/challenge-252/deadmarshal/python/ch1.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+def special_numbers(arr):
+ ret = []
+ for i in range(len(arr)):
+ if len(arr) % (i+1) == 0: ret.append(arr[i]**2)
+ return sum(ret)
+
+print(special_numbers([1,2,3,4]))
+print(special_numbers([2,7,1,19,18,3]))