aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2020-03-28 13:37:27 +0000
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2020-03-28 13:37:27 +0000
commit913e39f2a2364aaffe85ab4b4fe0fd70af8107f0 (patch)
treee4a7a3583be589fee949d1fb2ef92cdbd89d4664
parentb514c07c2e0ee5bf12568cbf26e6e2e763a90c3d (diff)
downloadperlweeklychallenge-club-913e39f2a2364aaffe85ab4b4fe0fd70af8107f0.tar.gz
perlweeklychallenge-club-913e39f2a2364aaffe85ab4b4fe0fd70af8107f0.tar.bz2
perlweeklychallenge-club-913e39f2a2364aaffe85ab4b4fe0fd70af8107f0.zip
- Fixed missing combinations.
-rw-r--r--challenge-053/mohammad-anwar/perl/ch-2.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-053/mohammad-anwar/perl/ch-2.pl b/challenge-053/mohammad-anwar/perl/ch-2.pl
index ade15bceda..9baabbd623 100644
--- a/challenge-053/mohammad-anwar/perl/ch-2.pl
+++ b/challenge-053/mohammad-anwar/perl/ch-2.pl
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Algorithm::Combinatorics qw(combinations);
+use Algorithm::Combinatorics qw(variations_with_repetition);
my $count = $ARGV[0] // 2;
die "ERROR: Invalid count $count.\n"
@@ -17,7 +17,7 @@ if ($count == 1) {
exit;
}
-my $iter = combinations($chars, $count);
+my $iter = variations_with_repetition($chars, $count);
my $char_sets = [];
while (my $char = $iter->next) {