diff options
| author | Conor Hoekstra <codereport@outlook.com> | 2021-10-13 15:59:37 -0400 |
|---|---|---|
| committer | Conor Hoekstra <codereport@outlook.com> | 2021-10-13 15:59:37 -0400 |
| commit | fe117d2fc5884464f681a2dd4d21456efe6c64f1 (patch) | |
| tree | ef6f2bb5a0a23cbe132596723a87423ce0b35adf | |
| parent | 51966386e30682ec3c5bf763a402a9178f6a0a88 (diff) | |
| download | perlweeklychallenge-club-fe117d2fc5884464f681a2dd4d21456efe6c64f1.tar.gz perlweeklychallenge-club-fe117d2fc5884464f681a2dd4d21456efe6c64f1.tar.bz2 perlweeklychallenge-club-fe117d2fc5884464f681a2dd4d21456efe6c64f1.zip | |
Challenge 111
| -rw-r--r-- | challenge-111/conor-hoekstra/ch-01.apl | 6 | ||||
| -rw-r--r-- | challenge-111/conor-hoekstra/ch-01.bqn | 6 | ||||
| -rw-r--r-- | challenge-111/conor-hoekstra/ch-01.ijs | 6 | ||||
| -rw-r--r-- | challenge-111/conor-hoekstra/ch-02.apl | 8 | ||||
| -rw-r--r-- | challenge-111/conor-hoekstra/ch-02.bqn | 4 |
5 files changed, 30 insertions, 0 deletions
diff --git a/challenge-111/conor-hoekstra/ch-01.apl b/challenge-111/conor-hoekstra/ch-01.apl new file mode 100644 index 0000000000..258593d268 --- /dev/null +++ b/challenge-111/conor-hoekstra/ch-01.apl @@ -0,0 +1,6 @@ +exists ← ∨/,⍤= + +⍝ Tests +input ← 4 4⍴⍳16 +10 exists input ⍝ 1 +20 exists input ⍝ 0 diff --git a/challenge-111/conor-hoekstra/ch-01.bqn b/challenge-111/conor-hoekstra/ch-01.bqn new file mode 100644 index 0000000000..75a1807ac3 --- /dev/null +++ b/challenge-111/conor-hoekstra/ch-01.bqn @@ -0,0 +1,6 @@ +Exists ← ∨´⥊∘= + +# Test +input ← 4‿4⥊↕16 +10 Exists input # 1 +20 Exists input # 0 diff --git a/challenge-111/conor-hoekstra/ch-01.ijs b/challenge-111/conor-hoekstra/ch-01.ijs new file mode 100644 index 0000000000..ca72766b1c --- /dev/null +++ b/challenge-111/conor-hoekstra/ch-01.ijs @@ -0,0 +1,6 @@ +exists =. [:+./,@:= + +NB. Tests +input =. i.4 4 +10 exists input NB. 1 +20 exists input NB. 0 diff --git a/challenge-111/conor-hoekstra/ch-02.apl b/challenge-111/conor-hoekstra/ch-02.apl new file mode 100644 index 0000000000..30f113bd9b --- /dev/null +++ b/challenge-111/conor-hoekstra/ch-02.apl @@ -0,0 +1,8 @@ +solution ← { + s ← ⍵/⍨(⊢≡⍳∘≢)∘⍋¨⍵ + ⊃s/⍨(⌈/=⊢)≢¨s +} + +⍝ Tests +solution 'ant' 'cat' 'dog' 'bee' 'deer' 'mouse' ⍝ deer +solution 'aNt' 'Cat' 'dog' 'bee' 'Deer' 'mouse' ⍝ Deer diff --git a/challenge-111/conor-hoekstra/ch-02.bqn b/challenge-111/conor-hoekstra/ch-02.bqn new file mode 100644 index 0000000000..421257a3cd --- /dev/null +++ b/challenge-111/conor-hoekstra/ch-02.bqn @@ -0,0 +1,4 @@ +Solution ← {⊑(⊢/˜·(⌈´=⊢)≠¨)(⊢/˜∧≡⊢)¨𝕩} + +# Tests (not doesn't work for uppercase) +Solution "ant"‿"cat"‿"dog"‿"bee"‿"deer"‿"mouse" # "deer" |
