diff options
| author | Lubos Kolouch <lubos@kolouch.net> | 2020-09-28 13:20:28 +0200 |
|---|---|---|
| committer | Lubos Kolouch <lubos@kolouch.net> | 2020-09-28 13:20:28 +0200 |
| commit | 7e3512ddfeb976911047c993f357f21abdee6761 (patch) | |
| tree | 978aaf92bc5bc34916e6569fdf8257144027afca | |
| parent | 52e114caced4bd7e9588f3949d46fb3a04705a33 (diff) | |
| download | perlweeklychallenge-club-7e3512ddfeb976911047c993f357f21abdee6761.tar.gz perlweeklychallenge-club-7e3512ddfeb976911047c993f357f21abdee6761.tar.bz2 perlweeklychallenge-club-7e3512ddfeb976911047c993f357f21abdee6761.zip | |
Chal 1 empty with tests
| -rw-r--r-- | challenge-080/lubos-kolouch/perl/ch_1.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/challenge-080/lubos-kolouch/perl/ch_1.pl b/challenge-080/lubos-kolouch/perl/ch_1.pl index 0b712a913a..e19e7bf626 100644 --- a/challenge-080/lubos-kolouch/perl/ch_1.pl +++ b/challenge-080/lubos-kolouch/perl/ch_1.pl @@ -14,16 +14,21 @@ use strict; use warnings; +use List::Util qw/min/; +use feature qw/say/; sub get_smallest_missing { my $arr = shift; + # map the arr to hash + say min( grep { $_ > 0 } @$arr); + } use Test::More; is(get_smallest_missing([5, 2, -2, 0]), 1); -is(get_smallest_missing([1, 8, -1]), 1); +is(get_smallest_missing([1, 8, -1]), 2); is(get_smallest_missing([2, 0, 1]), 1); done_testing; |
