diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2021-12-05 20:30:55 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-05 20:30:55 +0000 |
| commit | 373f2c853d826b3373942b0a0e83954a00806dbe (patch) | |
| tree | 2afb60f0785eb495af1e99c03f6e8f33ae5ed985 | |
| parent | 08cb7f5a40310234e72534e9e2f9d9b97b8a0694 (diff) | |
| parent | f1a7582acfd4891b42aee225a94e15ca40072506 (diff) | |
| download | perlweeklychallenge-club-373f2c853d826b3373942b0a0e83954a00806dbe.tar.gz perlweeklychallenge-club-373f2c853d826b3373942b0a0e83954a00806dbe.tar.bz2 perlweeklychallenge-club-373f2c853d826b3373942b0a0e83954a00806dbe.zip | |
Merge pull request #5331 from Abigail/abigail/week-141
Abigail/week 141
| -rw-r--r-- | challenge-141/abigail/blog.txt | 1 | ||||
| -rw-r--r-- | challenge-141/abigail/blog1.txt | 1 | ||||
| -rw-r--r-- | challenge-141/abigail/perl/ch-2.pl | 8 |
3 files changed, 6 insertions, 4 deletions
diff --git a/challenge-141/abigail/blog.txt b/challenge-141/abigail/blog.txt new file mode 100644 index 0000000000..08b309c1a2 --- /dev/null +++ b/challenge-141/abigail/blog.txt @@ -0,0 +1 @@ +https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-141-1.html diff --git a/challenge-141/abigail/blog1.txt b/challenge-141/abigail/blog1.txt new file mode 100644 index 0000000000..73dacf14de --- /dev/null +++ b/challenge-141/abigail/blog1.txt @@ -0,0 +1 @@ +https://abigail.github.io/HTML/Perl-Weekly-Challenge/week-141-2.html diff --git a/challenge-141/abigail/perl/ch-2.pl b/challenge-141/abigail/perl/ch-2.pl index 3417e54e1d..a8f61aab79 100644 --- a/challenge-141/abigail/perl/ch-2.pl +++ b/challenge-141/abigail/perl/ch-2.pl @@ -65,10 +65,10 @@ sub substrings ($n, $m, $prefix = -1, $max = $n) { # Recurse, once by picking up the first character of $n, and # once by skipping the first character. # - my $fc = substr ($n, 0, 1); - my $next = 10 * ($prefix == -1 ? 0 : $prefix) + $fc; - substrings (substr ($n, 1), $m, $next, $max) + - substrings (substr ($n, 1), $m, $prefix, $max); + my $fc = substr ($n, 0, 1); + my $n_prefix = 10 * ($prefix == -1 ? 0 : $prefix) + $fc; + substrings (substr ($n, 1), $m, $n_prefix, $max) + + substrings (substr ($n, 1), $m, $prefix, $max); } |
