aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2024-09-30 15:14:33 +0100
committerGitHub <noreply@github.com>2024-09-30 15:14:33 +0100
commit178d4e45aa6ff1bcc926830d279bdd1f54a0eaac (patch)
tree3e5feaa7cb056e7039502fb17120ad5a4ffb9bb1
parent0f48e7b96f6c4d16ca56fbe4da008ea8ca99ddae (diff)
parentde0bf11b06de4a2238a1cbdfd912500062d9b30d (diff)
downloadperlweeklychallenge-club-178d4e45aa6ff1bcc926830d279bdd1f54a0eaac.tar.gz
perlweeklychallenge-club-178d4e45aa6ff1bcc926830d279bdd1f54a0eaac.tar.bz2
perlweeklychallenge-club-178d4e45aa6ff1bcc926830d279bdd1f54a0eaac.zip
Merge pull request #10933 from codereport/master
:sparkles: Week 289 in BQN
-rw-r--r--challenge-289/conor-hoekstra/ch-1.bqn9
-rw-r--r--challenge-289/conor-hoekstra/ch-2.bqn10
2 files changed, 19 insertions, 0 deletions
diff --git a/challenge-289/conor-hoekstra/ch-1.bqn b/challenge-289/conor-hoekstra/ch-1.bqn
new file mode 100644
index 0000000000..e24347760c
--- /dev/null
+++ b/challenge-289/conor-hoekstra/ch-1.bqn
@@ -0,0 +1,9 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/289-1.bqn
+
+ThirdMaximum ← 2⊑((2⥊⌈´)∾˜⍷∘∨)
+
+# Tests
+•Show ThirdMaximum ⟨5, 6, 4, 1⟩ # 4
+•Show ThirdMaximum ⟨4, 5⟩ # 5
+•Show ThirdMaximum ⟨1, 2, 2, 3⟩ # 1
diff --git a/challenge-289/conor-hoekstra/ch-2.bqn b/challenge-289/conor-hoekstra/ch-2.bqn
new file mode 100644
index 0000000000..b1f1b9a211
--- /dev/null
+++ b/challenge-289/conor-hoekstra/ch-2.bqn
@@ -0,0 +1,10 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/289-2.bqn
+
+⟨Words, Unwords⟩ ⇐ •Import "../lib/string.bqn"
+
+Shuffle ← •rand.Deal∘≠⊸⊏
+Jumble ← Unwords·Shuffle⌾(¯1↓1↓⊢)¨Words
+
+# Tests
+•Show Jumble "This is a bunch a text that should be jumbled"