aboutsummaryrefslogtreecommitdiff
path: root/challenge-276/eric-cheung/python/ch-1.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-276/eric-cheung/python/ch-1.py')
-rwxr-xr-xchallenge-276/eric-cheung/python/ch-1.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-276/eric-cheung/python/ch-1.py b/challenge-276/eric-cheung/python/ch-1.py
new file mode 100755
index 0000000000..abb3112347
--- /dev/null
+++ b/challenge-276/eric-cheung/python/ch-1.py
@@ -0,0 +1,12 @@
+
+from itertools import combinations
+
+## arrHours = [12, 12, 30, 24, 24] ## Example 1
+## arrHours = [72, 48, 24, 5] ## Example 2
+arrHours = [12, 18, 24] ## Example 3
+
+arrComb = combinations(arrHours, 2)
+
+arrOutput = [arrLoop for arrLoop in list(arrComb) if sum(arrLoop) % 24 == 0]
+
+print (len(arrOutput))