From 8269e70482d2bf4fd8d8e059fae491a455f7db7a Mon Sep 17 00:00:00 2001 From: Bob Lied Date: Wed, 15 May 2024 09:09:28 -0500 Subject: Week 269 solution and blog reference --- challenge-269/bob-lied/blog.txt | 1 + challenge-269/bob-lied/perl/ch-2.pl | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 challenge-269/bob-lied/blog.txt 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; -- cgit