aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-080/lubos-kolouch/perl/ch-1.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-080/lubos-kolouch/perl/ch-1.pl b/challenge-080/lubos-kolouch/perl/ch-1.pl
index 7461ceb1b9..8decd6a953 100644
--- a/challenge-080/lubos-kolouch/perl/ch-1.pl
+++ b/challenge-080/lubos-kolouch/perl/ch-1.pl
@@ -14,7 +14,7 @@
use strict;
use warnings;
-use List::Util qw/min/;
+use List::Util qw/min max/;
use feature qw/say/;
sub get_smallest_missing {
@@ -29,7 +29,7 @@ sub get_smallest_missing {
# NOTE: the excercise does not say what to do if there is nothing missing
# so let's just return 0 as per Twitter confirmation
- for (0..scalar @$arr-2) {
+ while ($arr_min < max(@$arr)) {
$arr_min++;
return $arr_min unless grep { $_ == $arr_min } @$arr;