diff options
| -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" |
