diff options
Diffstat (limited to 'challenge-252/eric-cheung/python/ch-1.py')
| -rwxr-xr-x | challenge-252/eric-cheung/python/ch-1.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/challenge-252/eric-cheung/python/ch-1.py b/challenge-252/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..73003ac315 --- /dev/null +++ b/challenge-252/eric-cheung/python/ch-1.py @@ -0,0 +1,6 @@ +
+## arrInt = [1, 2, 3, 4] ## Example 1
+arrInt = [2, 7, 1, 19, 18, 3] ## Example 2
+
+arrOutput = [arrInt[nIndx] * arrInt[nIndx] for nIndx in range(len(arrInt)) if len(arrInt) % (nIndx + 1) == 0]
+print (sum(arrOutput))
|
