diff options
| -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; } |
