diff options
| author | Mark <53903062+andemark@users.noreply.github.com> | 2022-10-17 11:37:22 +0000 |
|---|---|---|
| committer | Mark <53903062+andemark@users.noreply.github.com> | 2022-10-17 11:37:22 +0000 |
| commit | 9a54785598fa8837786c8f52ccff81f07e3923ed (patch) | |
| tree | 009abbb92e80c17362bde3fb6a4d9e89b2d1c040 /challenge-187/mark-anderson | |
| parent | e1e584e33e60c1ac72e09fc085f5f2c6e2ed118b (diff) | |
| download | perlweeklychallenge-club-9a54785598fa8837786c8f52ccff81f07e3923ed.tar.gz perlweeklychallenge-club-9a54785598fa8837786c8f52ccff81f07e3923ed.tar.bz2 perlweeklychallenge-club-9a54785598fa8837786c8f52ccff81f07e3923ed.zip | |
Challenge 187 Solutions (Raku)
Diffstat (limited to 'challenge-187/mark-anderson')
| -rw-r--r-- | challenge-187/mark-anderson/raku/ch-2.raku | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/challenge-187/mark-anderson/raku/ch-2.raku b/challenge-187/mark-anderson/raku/ch-2.raku index 22a2329c2e..bee0723a1e 100644 --- a/challenge-187/mark-anderson/raku/ch-2.raku +++ b/challenge-187/mark-anderson/raku/ch-2.raku @@ -9,12 +9,11 @@ is-deeply max-magical-triplet(2, 4, 3), (4, 3, 2); sub max-magical-triplet(+$list) { $list.combinations(3) - .map({ |.permutations }) - .unique(with => &[eqv]) .flat .grep({ [and] $^a + $^b > $^c, $^b + $^c > $^a, $^a + $^c > $^b }) + .map({ .sort: -* }) andthen .elems ?? .max !! Empty.List } |
