diff options
| -rw-r--r-- | challenge-080/alexander-pankoff/perl/ch-1.pl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/challenge-080/alexander-pankoff/perl/ch-1.pl b/challenge-080/alexander-pankoff/perl/ch-1.pl new file mode 100644 index 0000000000..d6ef9089ee --- /dev/null +++ b/challenge-080/alexander-pankoff/perl/ch-1.pl @@ -0,0 +1,18 @@ +#!/usr/bin/env perl +use v5.20; +use utf8; +use strict; +use warnings; +use autodie; +use feature qw(say signatures); +no warnings 'experimental::signatures'; + +use List::Util qw(first); + +say smallest_positive_number_missing(@ARGV); + +sub smallest_positive_number_missing( @xs) { + my %lookup = map { $_ => 1 } @xs; + return first { !$lookup{$_} } 1 .. ( @xs + 1 ); +} + |
