diff options
| -rwxr-xr-x | challenge-009/joelle-maslak/perl5/ch-1.pl | 27 | ||||
| -rwxr-xr-x | challenge-009/joelle-maslak/perl6/ch-1.p6 | 11 |
2 files changed, 38 insertions, 0 deletions
diff --git a/challenge-009/joelle-maslak/perl5/ch-1.pl b/challenge-009/joelle-maslak/perl5/ch-1.pl new file mode 100755 index 0000000000..f91e6c8553 --- /dev/null +++ b/challenge-009/joelle-maslak/perl5/ch-1.pl @@ -0,0 +1,27 @@ +#!/usr/bin/env perl +use v5.24; +use strict; +use warnings; + +# +# Copyright (C) 2019 Joelle Maslak +# All Rights Reserved - See License +# + +# Turn on method signatures +use feature 'signatures'; +no warnings 'experimental::signatures'; + +use List::Util qw(uniqnum); + +while (1) { + state $num = 99; + $num++; + + my $square = $num * $num; + next if (join '', sort split '', $square) ne (join '', uniqnum sort split '', $square); + + say $square; + exit; +} + diff --git a/challenge-009/joelle-maslak/perl6/ch-1.p6 b/challenge-009/joelle-maslak/perl6/ch-1.p6 new file mode 100755 index 0000000000..0c6aff3fde --- /dev/null +++ b/challenge-009/joelle-maslak/perl6/ch-1.p6 @@ -0,0 +1,11 @@ +#!/usr/bin/env perl6 +use v6; + +# +# Copyright © 2019 Joelle Maslak +# All Rights Reserved - See License +# + +my $seq = (0..∞).map( *² ).grep( { .comb.sort eq .comb.unique.sort } ).grep( *.chars ≥ 5 ); +say $seq[0]; + |
