diff options
| author | Conor Hoekstra <codereport@outlook.com> | 2025-11-04 18:57:28 -0500 |
|---|---|---|
| committer | Conor Hoekstra <codereport@outlook.com> | 2025-11-04 18:57:28 -0500 |
| commit | 295d6f098b179ee022a9c6bc6f848be6430d0404 (patch) | |
| tree | db4866f38fa4393383cb052b3b021bbfd4da2495 | |
| parent | 78c40a6c5dcf2c3d02bf309d13bfb94821305436 (diff) | |
| download | perlweeklychallenge-club-295d6f098b179ee022a9c6bc6f848be6430d0404.tar.gz perlweeklychallenge-club-295d6f098b179ee022a9c6bc6f848be6430d0404.tar.bz2 perlweeklychallenge-club-295d6f098b179ee022a9c6bc6f848be6430d0404.zip | |
:sparkles: Week 346 P1 in BQN
| -rw-r--r-- | challenge-346/conor-hoekstra/ch-1.bqn | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/challenge-346/conor-hoekstra/ch-1.bqn b/challenge-346/conor-hoekstra/ch-1.bqn new file mode 100644 index 0000000000..89506e2f57 --- /dev/null +++ b/challenge-346/conor-hoekstra/ch-1.bqn @@ -0,0 +1,13 @@ +# For up to date code: +# https://github.com/codereport/bqn-code/blob/main/pwc/346-1.bqn + +u ⇐ •Import "/home/cph/bqn-test/test.bqn" + +LongestParentheses ← ⌈´·((((+´×∧´)0⊸≤)×(0=⊑∘⌽))·+`·-˝"()"=⌜⊢)¨·∾·(¯1↓↓)¨1↓↑ + +# Tests +u.UnitTest (LongestParentheses "(()())") ≡ 6 +u.UnitTest (LongestParentheses ")()())") ≡ 4 +u.UnitTest (LongestParentheses "((()))()(((()") ≡ 8 +u.UnitTest (LongestParentheses "))))((()(") ≡ 2 +u.UnitTest (LongestParentheses "()(()") ≡ 2 |
