aboutsummaryrefslogtreecommitdiff
path: root/challenge-277
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2024-07-10 21:46:54 +0100
committerGitHub <noreply@github.com>2024-07-10 21:46:54 +0100
commit9d262b99803ff962029f82fe2fe2b777c65d27dd (patch)
treec1e6821c31fe97edea4865a6e15c6594a168af91 /challenge-277
parent5ebe97797282cc6217010bcfacbf2a06364edf48 (diff)
parent2214844877d054829d3bcb2db6a0e99b5f0184fb (diff)
downloadperlweeklychallenge-club-9d262b99803ff962029f82fe2fe2b777c65d27dd.tar.gz
perlweeklychallenge-club-9d262b99803ff962029f82fe2fe2b777c65d27dd.tar.bz2
perlweeklychallenge-club-9d262b99803ff962029f82fe2fe2b777c65d27dd.zip
Merge pull request #10408 from codereport/master
Challenges 272-277 in BQN
Diffstat (limited to 'challenge-277')
-rw-r--r--challenge-277/conor-hoekstra/ch-1.bqn9
-rw-r--r--challenge-277/conor-hoekstra/ch-2.bqn10
2 files changed, 19 insertions, 0 deletions
diff --git a/challenge-277/conor-hoekstra/ch-1.bqn b/challenge-277/conor-hoekstra/ch-1.bqn
new file mode 100644
index 0000000000..a2df74238b
--- /dev/null
+++ b/challenge-277/conor-hoekstra/ch-1.bqn
@@ -0,0 +1,9 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/277-1.bqn
+
+CountCommon ← +´·⥊≡⌜○((1=≠¨)⊸/⊐⊸⊔)
+
+# Tests
+•Show ⟨"Perl", "is", "my", "friend"⟩ CountCommon ⟨"Perl", "and", "Raku", "are", "friend"⟩ # 2
+•Show ⟨"Perl", "and", "Python", "are", "very", "similar"⟩ CountCommon ⟨"Python", "is", "top", "in", "guest", "languages"⟩ # 1
+•Show ⟨"Perl", "is", "imperative", "Lisp", "is", "functional"⟩ CountCommon ⟨"Crystal", "is", "similar", "to", "Ruby"⟩ # 0
diff --git a/challenge-277/conor-hoekstra/ch-2.bqn b/challenge-277/conor-hoekstra/ch-2.bqn
new file mode 100644
index 0000000000..7b36e7df29
--- /dev/null
+++ b/challenge-277/conor-hoekstra/ch-2.bqn
@@ -0,0 +1,10 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/277-2.bqn
+
+⟨_Tri⟩ ⇐ •Import "../lib/modifiers.bqn"
+
+StrongPairs ← +´·∾(⌊(>∧0<⊢)|∘-)_Tri
+
+# Tests
+•Show StrongPairs ⟨1, 2, 3, 4, 5⟩ # 4
+•Show StrongPairs ⟨5, 7, 1, 7⟩ # 1 (technically my soluiton outputs 2)