From b973c2fea19436229a15c5f793bed6fc66a16f2e Mon Sep 17 00:00:00 2001 From: Mark <53903062+andemark@users.noreply.github.com> Date: Tue, 16 May 2023 16:17:23 +0000 Subject: ch-1.raku fixed for negative numbers --- challenge-217/mark-anderson/raku/ch-1.raku | 9 +++++---- 1 file 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] } -- cgit