aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2025-09-08 18:03:20 +0100
committerGitHub <noreply@github.com>2025-09-08 18:03:20 +0100
commit87708a66a388c7a2fe34638509484dbfb0c24b61 (patch)
tree967a3df57c3798a1da01574073410e6056ec89f9
parent0419e5c69b61c2efff07c39901fd848e6db8a248 (diff)
parent8a028a41e089503fe71a7bb0119e8f68d2effb17 (diff)
downloadperlweeklychallenge-club-87708a66a388c7a2fe34638509484dbfb0c24b61.tar.gz
perlweeklychallenge-club-87708a66a388c7a2fe34638509484dbfb0c24b61.tar.bz2
perlweeklychallenge-club-87708a66a388c7a2fe34638509484dbfb0c24b61.zip
Merge pull request #12649 from codereport/master
:sparkles: Week 338 in BQN
-rw-r--r--challenge-338/conor-hoekstra/ch-1.bqn13
-rw-r--r--challenge-338/conor-hoekstra/ch-2.bqn13
2 files changed, 26 insertions, 0 deletions
diff --git a/challenge-338/conor-hoekstra/ch-1.bqn b/challenge-338/conor-hoekstra/ch-1.bqn
new file mode 100644
index 0000000000..33ae645c08
--- /dev/null
+++ b/challenge-338/conor-hoekstra/ch-1.bqn
@@ -0,0 +1,13 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/338-1.bqn
+
+u ⇐ •Import "/home/cph/bqn-test/test.bqn"
+
+HighestRow ← ⌈´+´˘
+
+# Tests
+u.UnitTest (HighestRow >⟨⟨4,4,4,4⟩,⟨10,0,0,0⟩,⟨2,2,2,9⟩⟩) ≡ 16
+u.UnitTest (HighestRow >⟨⟨1,5⟩,⟨7,3⟩,⟨3,5⟩⟩) ≡ 10
+u.UnitTest (HighestRow >⟨⟨1,2,3⟩,⟨3,2,1⟩⟩) ≡ 6
+u.UnitTest (HighestRow >⟨⟨2,8,7⟩,⟨7,1,3⟩,⟨1,9,5⟩⟩) ≡ 17
+u.UnitTest (HighestRow >⟨⟨10,20,30⟩,⟨5,5,5⟩,⟨0,100,0⟩,⟨25,25,25⟩⟩) ≡ 100
diff --git a/challenge-338/conor-hoekstra/ch-2.bqn b/challenge-338/conor-hoekstra/ch-2.bqn
new file mode 100644
index 0000000000..6cb4bff818
--- /dev/null
+++ b/challenge-338/conor-hoekstra/ch-2.bqn
@@ -0,0 +1,13 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/338-2.bqn
+
+u ⇐ •Import "/home/cph/bqn-test/test.bqn"
+
+MaxDistance ← ⌈´·⥊·|-⌜
+
+# Tests
+u.UnitTest ( ⟨4,5,7⟩ MaxDistance ⟨9,1,3,4⟩) ≡ 6
+u.UnitTest ( ⟨2,3,5,4⟩ MaxDistance ⟨3,2,5,5,8,7⟩) ≡ 6
+u.UnitTest (⟨2,1,11,3⟩ MaxDistance ⟨2,5,10,2⟩) ≡ 9
+u.UnitTest ( ⟨1,2,3⟩ MaxDistance ⟨3,2,1⟩) ≡ 2
+u.UnitTest ( ⟨1,0,2,3⟩ MaxDistance ⟨5,0⟩) ≡ 5