diff options
| -rw-r--r-- | challenge-083/alexander-pankoff/perl/lib/Combinations.pm | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/challenge-083/alexander-pankoff/perl/lib/Combinations.pm b/challenge-083/alexander-pankoff/perl/lib/Combinations.pm index 73b22cfa65..2fb005c0a7 100644 --- a/challenge-083/alexander-pankoff/perl/lib/Combinations.pm +++ b/challenge-083/alexander-pankoff/perl/lib/Combinations.pm @@ -4,19 +4,13 @@ use warnings; use feature qw(signatures); no warnings 'experimental::signatures'; -use Carp qw(croak); - use Exporter qw(import); our @EXPORT_OK = qw(combinations); # returns possible combinations of $length elements from @pool. sub combinations ( $count, @pool ) { - croak "cannot build combinations with $count elements from a list of " - . scalar(@pool) - . " elements" - if $count > @pool; - return () if $count == 0; + return () if $count == 0 || $count > @pool; return map { [$_] } @pool if $count == 1; my @combinations; |
