aboutsummaryrefslogtreecommitdiff
path: root/challenge-198
diff options
context:
space:
mode:
authorMark <53903062+andemark@users.noreply.github.com>2023-01-03 11:04:55 +0000
committerMark <53903062+andemark@users.noreply.github.com>2023-01-03 11:04:55 +0000
commit98fb5933920901e75868fa5cb9d35ad7d0b8e15a (patch)
tree7d4d80aa76fe0e07d7383addb6657f96ffb65914 /challenge-198
parent90659b4e0314ea355484586dfba8ded49bcb8838 (diff)
downloadperlweeklychallenge-club-98fb5933920901e75868fa5cb9d35ad7d0b8e15a.tar.gz
perlweeklychallenge-club-98fb5933920901e75868fa5cb9d35ad7d0b8e15a.tar.bz2
perlweeklychallenge-club-98fb5933920901e75868fa5cb9d35ad7d0b8e15a.zip
ch-1.raku fixed
Diffstat (limited to 'challenge-198')
-rw-r--r--challenge-198/mark-anderson/raku/ch-1.raku11
1 files changed, 6 insertions, 5 deletions
diff --git a/challenge-198/mark-anderson/raku/ch-1.raku b/challenge-198/mark-anderson/raku/ch-1.raku
index 89737a8c47..d84460f9e3 100644
--- a/challenge-198/mark-anderson/raku/ch-1.raku
+++ b/challenge-198/mark-anderson/raku/ch-1.raku
@@ -1,12 +1,13 @@
#!/usr/bin/env raku
use Test;
-is max-gap(2,5,8,1), 2;
-is max-gap(3), 0;
-is max-gap(1..9), 8;
-is max-gap(1,6,5,2,7,9,14,15,20,24,29,30,25), 5;
+is max-gap(2,5,8,1), 2;
+is max-gap(3), 0;
+is max-gap(1..9), 8;
+is max-gap(1,0,3,-2,-4), 3;
+is max-gap(-4,-2,-1,1,3), 3;
sub max-gap(+$list)
{
- $list.rotor(2 => -1).map({ .tail - .head }).maxpairs.elems
+ $list.sort.rotor(2 => -1).map({ .tail - .head }).maxpairs.elems
}