From e4e381c78bb60a49b4cac93b6c5d69e42759abda Mon Sep 17 00:00:00 2001 From: Conor Hoekstra Date: Mon, 29 Jul 2024 10:42:36 -0400 Subject: :sparkles: Week 280 in BQN --- challenge-280/conor-hoekstra/ch-1.bqn | 9 +++++++++ challenge-280/conor-hoekstra/ch-2.bqn | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 challenge-280/conor-hoekstra/ch-1.bqn create mode 100644 challenge-280/conor-hoekstra/ch-2.bqn 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 -- cgit