aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2021-12-28 22:28:37 +0000
committerGitHub <noreply@github.com>2021-12-28 22:28:37 +0000
commit13e64bcb25a952c2b4f82d3edaf298ada4f855b5 (patch)
tree1936a2b26e3c2d03dd29f245eebc5ddb9ff5cff7
parentcc72a2ea325ac4a00b6a84dd29c5b0c94990f37c (diff)
parent4262968405be0dc7b75cecb42deaa6e059b36ccb (diff)
downloadperlweeklychallenge-club-13e64bcb25a952c2b4f82d3edaf298ada4f855b5.tar.gz
perlweeklychallenge-club-13e64bcb25a952c2b4f82d3edaf298ada4f855b5.tar.bz2
perlweeklychallenge-club-13e64bcb25a952c2b4f82d3edaf298ada4f855b5.zip
Merge pull request #5435 from codereport/master
Week 144 Solution in APL
-rw-r--r--challenge-144/conor-hoekstra/ch-01.apl9
-rw-r--r--challenge-145/conor-hoekstra/ch-01.apl4
-rw-r--r--challenge-145/conor-hoekstra/ch-02.bqn9
3 files changed, 22 insertions, 0 deletions
diff --git a/challenge-144/conor-hoekstra/ch-01.apl b/challenge-144/conor-hoekstra/ch-01.apl
new file mode 100644
index 0000000000..782d89c9ce
--- /dev/null
+++ b/challenge-144/conor-hoekstra/ch-01.apl
@@ -0,0 +1,9 @@
+factors ← ∪⍳∨⊢
+isPrime ← 2≤≢∘factors
+
+⍝ Solution
+2 17⍴{⍵/⍨((2 3∊⍨≢)∧∧/)¨(isPrime¨¯1↓factors)¨⍵} ⍳100
+
+⍝ Output
+ 4 6 9 10 14 15 21 22 25 26 33 34 35 38 39 46 49
+51 55 57 58 62 65 69 74 77 82 85 86 87 91 93 94 95
diff --git a/challenge-145/conor-hoekstra/ch-01.apl b/challenge-145/conor-hoekstra/ch-01.apl
new file mode 100644
index 0000000000..e48168c64f
--- /dev/null
+++ b/challenge-145/conor-hoekstra/ch-01.apl
@@ -0,0 +1,4 @@
+dotProduct ← +.×
+
+⍝ Test
+1 2 3 dotProduct 4 5 6 ⍝ 32
diff --git a/challenge-145/conor-hoekstra/ch-02.bqn b/challenge-145/conor-hoekstra/ch-02.bqn
new file mode 100644
index 0000000000..7f2ffd35f8
--- /dev/null
+++ b/challenge-145/conor-hoekstra/ch-02.bqn
@@ -0,0 +1,9 @@
+PalindromicTree ← {1↓(⌽≡⊢)¨⊸/˜⍷∾´↑¨↓𝕩}
+
+# Tests
+PalindromicTree "redivider" # ⟨ "r" "redivider" "e" "edivide" "d" "divid" "i" "ivi" "v" ⟩
+PalindromicTree "deific" # ⟨ "d" "e" "i" "ifi" "f" "c" ⟩
+PalindromicTree "rotors" # ⟨ "r" "rotor" "o" "oto" "t" "s" ⟩
+PalindromicTree "challenge" # ⟨ "c" "h" "a" "l" "ll" "e" "n" "g" ⟩
+PalindromicTree "champion" # ⟨ "c" "h" "a" "m" "p" "i" "o" "n" ⟩
+PalindromicTree "christmas" # ⟨ "c" "h" "r" "i" "s" "t" "m" "a" ⟩