From 6e08a3189797e123107f7e6944f43ff5d9cab9bd Mon Sep 17 00:00:00 2001 From: Conor Hoekstra Date: Tue, 28 Dec 2021 17:11:29 -0500 Subject: Week 144 Solution in APL --- challenge-144/conor-hoekstra/ch-01.apl | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 challenge-144/conor-hoekstra/ch-01.apl 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 -- cgit From 7df6b030c57d6548a8c9456dfeb7f1d17d51489a Mon Sep 17 00:00:00 2001 From: Conor Hoekstra Date: Tue, 28 Dec 2021 17:27:05 -0500 Subject: Week 145 Solution in APL & BQN --- challenge-145/conor-hoekstra/ch-01.apl | 4 ++++ challenge-145/conor-hoekstra/ch-02.bqn | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 challenge-145/conor-hoekstra/ch-01.apl create mode 100644 challenge-145/conor-hoekstra/ch-02.bqn 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" ⟩ -- cgit