diff options
| author | Conor Hoekstra <codereport@outlook.com> | 2024-07-29 10:42:36 -0400 |
|---|---|---|
| committer | Conor Hoekstra <codereport@outlook.com> | 2024-07-29 10:42:36 -0400 |
| commit | e4e381c78bb60a49b4cac93b6c5d69e42759abda (patch) | |
| tree | 3ddb097ac42fb5ab2fabb8b2bfd0372051533251 | |
| parent | a2a0393bed0a645143ff47e7c2ef85c67fa16528 (diff) | |
| download | perlweeklychallenge-club-e4e381c78bb60a49b4cac93b6c5d69e42759abda.tar.gz perlweeklychallenge-club-e4e381c78bb60a49b4cac93b6c5d69e42759abda.tar.bz2 perlweeklychallenge-club-e4e381c78bb60a49b4cac93b6c5d69e42759abda.zip | |
: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 |
