diff options
| author | Bob Lied <boblied+github@gmail.com> | 2024-05-15 09:09:28 -0500 |
|---|---|---|
| committer | Bob Lied <boblied+github@gmail.com> | 2024-05-15 09:09:28 -0500 |
| commit | 8269e70482d2bf4fd8d8e059fae491a455f7db7a (patch) | |
| tree | 3fa6e55f9cc069a0a7c1c6f3d3d42718c0f89e27 | |
| parent | ab73297b264933a335934aa9cdd5ddb3c1aae092 (diff) | |
| download | perlweeklychallenge-club-8269e70482d2bf4fd8d8e059fae491a455f7db7a.tar.gz perlweeklychallenge-club-8269e70482d2bf4fd8d8e059fae491a455f7db7a.tar.bz2 perlweeklychallenge-club-8269e70482d2bf4fd8d8e059fae491a455f7db7a.zip | |
Week 269 solution and blog reference
| -rw-r--r-- | challenge-269/bob-lied/blog.txt | 1 | ||||
| -rw-r--r-- | challenge-269/bob-lied/perl/ch-2.pl | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/challenge-269/bob-lied/blog.txt b/challenge-269/bob-lied/blog.txt new file mode 100644 index 0000000000..19c83abd6f --- /dev/null +++ b/challenge-269/bob-lied/blog.txt @@ -0,0 +1 @@ +https://dev.to/boblied/pwc-269-two-of-us-distributing-elements-54m diff --git a/challenge-269/bob-lied/perl/ch-2.pl b/challenge-269/bob-lied/perl/ch-2.pl index 6c99b8625c..4947e3f515 100644 --- a/challenge-269/bob-lied/perl/ch-2.pl +++ b/challenge-269/bob-lied/perl/ch-2.pl @@ -60,9 +60,10 @@ my $DoTest = 0; GetOptions("test" => \$DoTest, "verbose" => \$Verbose); exit(!runTest()) if $DoTest; +say "(", join(", ", distElem(@ARGV)->@*), ")"; + sub distElem(@ints) { - #return [] if $#ints < 1; my @arr = ( [ (shift @ints) // () ], [ (shift @ints) // () ] ); push @{$arr[ ( $arr[0][-1] <= $arr[1][-1] ) ]}, $_ for @ints; |
