aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xchallenge-284/feng-chang/raku/ch-2.raku6
1 files 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(',');