aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandrezgz <andrezgz@gmail.com>2024-09-09 22:43:17 -0300
committerandrezgz <andrezgz@gmail.com>2024-09-09 22:43:17 -0300
commit5c9e3a8c6c9506a633d6333bbbdbb04c9d6be3b5 (patch)
treed7f13b878b364148df93a48ede2d3c5a3f74fcbb
parent27bf21747ebc688648590e44876fe593858cbb10 (diff)
downloadperlweeklychallenge-club-5c9e3a8c6c9506a633d6333bbbdbb04c9d6be3b5.tar.gz
perlweeklychallenge-club-5c9e3a8c6c9506a633d6333bbbdbb04c9d6be3b5.tar.bz2
perlweeklychallenge-club-5c9e3a8c6c9506a633d6333bbbdbb04c9d6be3b5.zip
challenge-282-ch-1-fix
-rwxr-xr-xchallenge-282/andrezgz/perl/ch-1.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-282/andrezgz/perl/ch-1.pl b/challenge-282/andrezgz/perl/ch-1.pl
index 426e031b30..d4f8999070 100755
--- a/challenge-282/andrezgz/perl/ch-1.pl
+++ b/challenge-282/andrezgz/perl/ch-1.pl
@@ -38,8 +38,8 @@ sub good_integer {
my $d = $-[2] - $-[1];
# if the distance is N, return the sequence
return $1 x N if $d == N;
- # otherwise, remove these digits and try again
- $int = substr $int, $d;
+ # otherwise, remove up to the last captured digit and try again
+ $int = substr $int, $-[2];
}
return -1;
}