diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2021-10-23 17:26:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-23 17:26:31 +0100 |
| commit | 0e9fbe1d4ed97319ace3d41e221c1abdbad34301 (patch) | |
| tree | 0d1f94e4e5d11a35bbfd61d44f1d0d895db840a1 | |
| parent | e6c61d7c1761ced89b08a50864e101a9a93ff920 (diff) | |
| parent | 563beb03b61fec154547e9b5eced7455891c8135 (diff) | |
| download | perlweeklychallenge-club-0e9fbe1d4ed97319ace3d41e221c1abdbad34301.tar.gz perlweeklychallenge-club-0e9fbe1d4ed97319ace3d41e221c1abdbad34301.tar.bz2 perlweeklychallenge-club-0e9fbe1d4ed97319ace3d41e221c1abdbad34301.zip | |
Merge pull request #5084 from codereport/master
APL Solutions for Week 1 & 83
| -rw-r--r-- | challenge-001/conor-hoekstra/ch-01.apl | 5 | ||||
| -rw-r--r-- | challenge-083/conor-hoekstra/ch-01.apl | 5 | ||||
| -rw-r--r-- | challenge-083/conor-hoekstra/ch-02.apl | 9 |
3 files changed, 19 insertions, 0 deletions
diff --git a/challenge-001/conor-hoekstra/ch-01.apl b/challenge-001/conor-hoekstra/ch-01.apl new file mode 100644 index 0000000000..b132a39731 --- /dev/null +++ b/challenge-001/conor-hoekstra/ch-01.apl @@ -0,0 +1,5 @@ +eReplace ← 'E'@('e'∘=) +eCount ← +/'e'∘= + +(eReplace,eCount) 'Perl Weekly Challenge' +⍝ PErl WEEkly ChallEngE 5 diff --git a/challenge-083/conor-hoekstra/ch-01.apl b/challenge-083/conor-hoekstra/ch-01.apl new file mode 100644 index 0000000000..516a42a16b --- /dev/null +++ b/challenge-083/conor-hoekstra/ch-01.apl @@ -0,0 +1,5 @@ +solution ← ≢∘∊¯1↓1↓' '(≠⊆⊢)⊢ + +⍝ Tests +solution 'The purpose of our lives is to be happy' ⍝ 23 +solution 'The Weekly Challenge' ⍝ 6 diff --git a/challenge-083/conor-hoekstra/ch-02.apl b/challenge-083/conor-hoekstra/ch-02.apl new file mode 100644 index 0000000000..f71f9c1cba --- /dev/null +++ b/challenge-083/conor-hoekstra/ch-02.apl @@ -0,0 +1,9 @@ + flipArray ← { + m ← ⍉2(⊥⍣¯1)⍳¯1+2*≢⍵ ⍝ mask + s ← +/x(×⍤1)1-2×m ⍝ sums + ⌊/(+/m)/⍨s=⌊/s/⍨0≤s + } + +⍝ Tests +flipArray 2 10 12 ⍝ 1 +flipArray 3 10 8 ⍝ 1 |
