aboutsummaryrefslogtreecommitdiff
path: root/challenge-092/gugod
diff options
context:
space:
mode:
authorKang-min Liu <gugod@gugod.org>2020-12-25 08:33:28 +0900
committerKang-min Liu <gugod@gugod.org>2020-12-25 08:33:28 +0900
commit5034a1a35a865e5363d0c99f087f658bb6223422 (patch)
treec1a51236d9598322117f935cc846161913bdc365 /challenge-092/gugod
parent59868862572b44e5b8727bbc8b93cb519cc359af (diff)
downloadperlweeklychallenge-club-5034a1a35a865e5363d0c99f087f658bb6223422.tar.gz
perlweeklychallenge-club-5034a1a35a865e5363d0c99f087f658bb6223422.tar.bz2
perlweeklychallenge-club-5034a1a35a865e5363d0c99f087f658bb6223422.zip
harness the power of Z
Diffstat (limited to 'challenge-092/gugod')
-rw-r--r--challenge-092/gugod/raku/ch-1.raku4
1 files changed, 1 insertions, 3 deletions
diff --git a/challenge-092/gugod/raku/ch-1.raku b/challenge-092/gugod/raku/ch-1.raku
index b92ef7a57d..2bb2dadf14 100644
--- a/challenge-092/gugod/raku/ch-1.raku
+++ b/challenge-092/gugod/raku/ch-1.raku
@@ -6,10 +6,8 @@ sub MAIN {
sub isomorphic (Str $A, Str $B) {
my %trans;
return False unless $A.chars == $B.chars;
- for 0..^$A.chars -> $i {
- my $a = $A.substr($i, 1);
- my $b = $B.substr($i, 1);
+ for $A.comb Z $B.comb -> ($a, $b) {
if %trans{"ab"}{$a}:exists and %trans{"ab"}{$a} ne $b {
return False
}