aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-276/kai-burgdorf/javascript/ch-1.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/challenge-276/kai-burgdorf/javascript/ch-1.js b/challenge-276/kai-burgdorf/javascript/ch-1.js
new file mode 100644
index 0000000000..1c45ef6e55
--- /dev/null
+++ b/challenge-276/kai-burgdorf/javascript/ch-1.js
@@ -0,0 +1,17 @@
+//const hours = [12, 12, 30, 24, 24];
+//const hours = [72, 48, 24, 5];
+//const hours = [12, 18, 24];
+
+var pairs = [];
+
+hours.forEach((firstSummand, i) => {
+ hours.forEach((secondSummand, j) => {
+ if( j>i && ((firstSummand + secondSummand) % 24) == 0) {
+ pairs.push("Pair " + (pairs.length+1) + ": (" + firstSummand + ", " + secondSummand + ")");
+ }
+ })
+})
+
+console.log("Output: " + pairs.length + "\n" + JSON.stringify(pairs));
+
+