From d4ab722f2432ec0cce5c3ce7ec68fc89e3ee0434 Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Fri, 5 Jun 2020 21:47:20 -0600 Subject: [PATCH] Challenge 63 Solutions --- challenge-063/mark-anderson/raku/ch-1.raku | 2 +- challenge-063/mark-anderson/raku/ch-2.raku | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/challenge-063/mark-anderson/raku/ch-1.raku b/challenge-063/mark-anderson/raku/ch-1.raku index 5affbfd16d..22c8fb26e2 100644 --- a/challenge-063/mark-anderson/raku/ch-1.raku +++ b/challenge-063/mark-anderson/raku/ch-1.raku @@ -7,6 +7,6 @@ say last_word(join(' ', 1..1e6), rx/^(3.*?)**3/); sub last_word(Str $string, Regex $regexp) { - return $string.split(/\s+/).grep($regexp).Array.pop || Nil; + return $string.words.grep($regexp).Array.pop || Nil; } diff --git a/challenge-063/mark-anderson/raku/ch-2.raku b/challenge-063/mark-anderson/raku/ch-2.raku index f8d58772c3..fc8033a34c 100644 --- a/challenge-063/mark-anderson/raku/ch-2.raku +++ b/challenge-063/mark-anderson/raku/ch-2.raku @@ -4,7 +4,6 @@ sub MAIN(Str $str = "xyxx") { my @arr = $str.comb; for 1 .. Inf -> $i { - next if $i %% $str.chars; @arr .= rotate($i % $str.chars); say $i and last if @arr.join eq $str; }