From 30a42138e1d8bdd2f174e06fb18515ced0b2b241 Mon Sep 17 00:00:00 2001 From: 冯昶 Date: Tue, 27 Aug 2024 15:02:01 +0800 Subject: fix --- challenge-284/feng-chang/raku/ch-2.raku | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/challenge-284/feng-chang/raku/ch-2.raku b/challenge-284/feng-chang/raku/ch-2.raku index 25a4be73c5..aa6f179bf5 100755 --- a/challenge-284/feng-chang/raku/ch-2.raku +++ b/challenge-284/feng-chang/raku/ch-2.raku @@ -3,12 +3,10 @@ unit sub MAIN(Str:D $L1, Str:D $L2); my %pos = $L2.comb(/\d+/).map({ $_ => $++ }); - my (@list3, @list4); for $L1.comb(/\d+/) -> $n { - %pos{$n}.defined ?? - @list3[%pos{$n}].push($n) !! - @list4.push($n); + with %pos{$n} { @list3[$_].push($n); } + else { @list4.push($n); } } put (|@list3[*;*], |@list4.sort).join(','); -- cgit