diff options
| -rw-r--r-- | challenge-051/e-choroba/blog.txt | 1 | ||||
| -rwxr-xr-x | challenge-051/e-choroba/perl/ch-2.pl | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/challenge-051/e-choroba/blog.txt b/challenge-051/e-choroba/blog.txt new file mode 100644 index 0000000000..66ce5ed9d2 --- /dev/null +++ b/challenge-051/e-choroba/blog.txt @@ -0,0 +1 @@ +http://blogs.perl.org/users/e_choroba/2020/03/perl-weekly-challenge-051-3-sum-and-colourful-numbers.html diff --git a/challenge-051/e-choroba/perl/ch-2.pl b/challenge-051/e-choroba/perl/ch-2.pl index 47505bbab9..b911cb2012 100755 --- a/challenge-051/e-choroba/perl/ch-2.pl +++ b/challenge-051/e-choroba/perl/ch-2.pl @@ -12,9 +12,7 @@ sub is_colorful_number { my $count = 0; for my $length (1 .. $max_length) { for my $pos (0 .. $max_length - $length) { - my @pattern = ( - (0) x $pos, (1) x $length, (0) x ($max_length - $pos - $length) - ); + my @pattern = ((0) x $pos, (1) x $length); undef $uniq{ product((split //, $n)[ grep $pattern[$_], 0 .. $#pattern ]) }; |
