diff options
| author | Mohammad Sajid Anwar <Mohammad.Anwar@yahoo.com> | 2024-07-29 18:11:12 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-29 18:11:12 +0100 |
| commit | 16a4fa701d1b3f391a54a7c2e384b1375524906d (patch) | |
| tree | fa22fa536b8d331a3493ec7aab24fe35deb483cf | |
| parent | d273c6995b957c908fb4ce7898158d696cea9604 (diff) | |
| parent | e4e381c78bb60a49b4cac93b6c5d69e42759abda (diff) | |
| download | perlweeklychallenge-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.bqn | 9 | ||||
| -rw-r--r-- | challenge-280/conor-hoekstra/ch-2.bqn | 13 |
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 |
