diff options
Diffstat (limited to 'challenge-261/sgreen/perl/ch-2.pl')
| -rwxr-xr-x | challenge-261/sgreen/perl/ch-2.pl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/challenge-261/sgreen/perl/ch-2.pl b/challenge-261/sgreen/perl/ch-2.pl new file mode 100755 index 0000000000..5e32b08356 --- /dev/null +++ b/challenge-261/sgreen/perl/ch-2.pl @@ -0,0 +1,21 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use feature 'say'; +use experimental 'signatures'; + +use List::Util 'any'; + +sub main (@ints) { + my $start = pop(@ints); + my $solution = $start; + + while ( any { $solution == $_ } @ints ) { + $solution *= 2; + } + + say $solution; +} + +main(@ARGV);
\ No newline at end of file |
