aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2024-07-29 18:11:12 +0100
committerGitHub <noreply@github.com>2024-07-29 18:11:12 +0100
commit16a4fa701d1b3f391a54a7c2e384b1375524906d (patch)
treefa22fa536b8d331a3493ec7aab24fe35deb483cf
parentd273c6995b957c908fb4ce7898158d696cea9604 (diff)
parente4e381c78bb60a49b4cac93b6c5d69e42759abda (diff)
downloadperlweeklychallenge-club-16a4fa701d1b3f391a54a7c2e384b1375524906d.tar.gz
perlweeklychallenge-club-16a4fa701d1b3f391a54a7c2e384b1375524906d.tar.bz2
perlweeklychallenge-club-16a4fa701d1b3f391a54a7c2e384b1375524906d.zip
Merge pull request #10514 from codereport/master
:sparkles: Week 280 in BQN
-rw-r--r--challenge-280/conor-hoekstra/ch-1.bqn9
-rw-r--r--challenge-280/conor-hoekstra/ch-2.bqn13
2 files changed, 22 insertions, 0 deletions
diff --git a/challenge-280/conor-hoekstra/ch-1.bqn b/challenge-280/conor-hoekstra/ch-1.bqn
new file mode 100644
index 0000000000..682aded1af
--- /dev/null
+++ b/challenge-280/conor-hoekstra/ch-1.bqn
@@ -0,0 +1,9 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/280-1.bqn
+
+AppearsTwice ← ⊑¬∘∊⊸/
+
+# Tests
+•Show AppearsTwice "acbddbca" # "d"
+•Show AppearsTwice "abccd" # "c"
+•Show AppearsTwice "abcdabbb" # "a"
diff --git a/challenge-280/conor-hoekstra/ch-2.bqn b/challenge-280/conor-hoekstra/ch-2.bqn
new file mode 100644
index 0000000000..24a9fde227
--- /dev/null
+++ b/challenge-280/conor-hoekstra/ch-2.bqn
@@ -0,0 +1,13 @@
+# For up to date code:
+# https://github.com/codereport/bqn-code/blob/main/pwc/280-2.bqn
+
+AsteriskCount ← +´'*'=(¬·≠`'|'=⊢)⊸/ # Solution 1
+AsteriskCount2 ← +´(¬·≠`'|'=⊢)×'*'⊸= # Solution 2
+
+# Tests
+•Show AsteriskCount "p|*e*rl|w**e|*ekly|" # 2
+•Show AsteriskCount "perl" # 0
+•Show AsteriskCount "th|ewe|e**|k|l***ych|alleng|e" # 5
+•Show AsteriskCount2 "p|*e*rl|w**e|*ekly|" # 2
+•Show AsteriskCount2 "perl" # 0
+•Show AsteriskCount2 "th|ewe|e**|k|l***ych|alleng|e" # 5