diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2023-05-16 17:28:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-16 17:28:11 +0100 |
| commit | b03376e69cfb06500ee880f683608a70a81fa2c7 (patch) | |
| tree | f8b24841e5681e90dc9bdd2ea42dd621ad95df2a | |
| parent | 833836697f2d0121bf791c605b0c3aae35411500 (diff) | |
| parent | b973c2fea19436229a15c5f793bed6fc66a16f2e (diff) | |
| download | perlweeklychallenge-club-b03376e69cfb06500ee880f683608a70a81fa2c7.tar.gz perlweeklychallenge-club-b03376e69cfb06500ee880f683608a70a81fa2c7.tar.bz2 perlweeklychallenge-club-b03376e69cfb06500ee880f683608a70a81fa2c7.zip | |
Merge pull request #8089 from andemark/challenge-217-Raku
ch-1.raku fixed for negative numbers
| -rw-r--r-- | challenge-217/mark-anderson/raku/ch-1.raku | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/challenge-217/mark-anderson/raku/ch-1.raku b/challenge-217/mark-anderson/raku/ch-1.raku index bad514c662..6b41a8d86d 100644 --- a/challenge-217/mark-anderson/raku/ch-1.raku +++ b/challenge-217/mark-anderson/raku/ch-1.raku @@ -1,11 +1,12 @@ #!/usr/bin/env raku use Test; -is sorted-matrix([3, 1, 2], [5, 2, 4], [0, 1, 3]), 1; -is sorted-matrix([2, 1], [4, 5]), 4; -is sorted-matrix([1, 0, 3], [0, 0, 0], [1, 2, 1]), 0; +is sorted-matrix([3,1,2], [5,2,4], [0,1,3]), 1; +is sorted-matrix([2,1], [4,5]), 4; +is sorted-matrix([1,0,3], [0,0,0], [1,2,1]), 0; +is sorted-matrix([1,2,3,4], [[4,-85,9], [2,-57, [1,2,3,-42], [[0],[1,2]]]], [-3,43]), -42; sub sorted-matrix(+$a) { - $a.comb(/\d+/).sort(+*)[2]; + $a.comb(/<[-\d]>+/).sort(+*)[2] } |
