diff options
| author | andrezgz <andrezgz@gmail.com> | 2024-09-09 22:43:17 -0300 |
|---|---|---|
| committer | andrezgz <andrezgz@gmail.com> | 2024-09-09 22:43:17 -0300 |
| commit | 5c9e3a8c6c9506a633d6333bbbdbb04c9d6be3b5 (patch) | |
| tree | d7f13b878b364148df93a48ede2d3c5a3f74fcbb | |
| parent | 27bf21747ebc688648590e44876fe593858cbb10 (diff) | |
| download | perlweeklychallenge-club-5c9e3a8c6c9506a633d6333bbbdbb04c9d6be3b5.tar.gz perlweeklychallenge-club-5c9e3a8c6c9506a633d6333bbbdbb04c9d6be3b5.tar.bz2 perlweeklychallenge-club-5c9e3a8c6c9506a633d6333bbbdbb04c9d6be3b5.zip | |
challenge-282-ch-1-fix
| -rwxr-xr-x | challenge-282/andrezgz/perl/ch-1.pl | 4 |
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; } |
