From 45dde2825a40a6296949f33d1004ae51e006c940 Mon Sep 17 00:00:00 2001 From: robbie-hatley Date: Wed, 15 Nov 2023 08:51:54 -0800 Subject: Updated 243-1 --- challenge-243/robbie-hatley/perl/ch-1.pl | 4 +++- challenge-243/robbie-hatley/perl/ch-2.pl | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/challenge-243/robbie-hatley/perl/ch-1.pl b/challenge-243/robbie-hatley/perl/ch-1.pl index 828d630b59..33fdb09fe1 100755 --- a/challenge-243/robbie-hatley/perl/ch-1.pl +++ b/challenge-243/robbie-hatley/perl/ch-1.pl @@ -78,7 +78,9 @@ sub reverse_pairs ($aref) { my @rp = (); for ( my $i = 0 ; $i <= $#$aref - 1 ; ++$i ) { for ( my $j = $i + 1 ; $j <= $#$aref - 0 ; ++$j ) { - push @rp, [$$aref[$i], $$aref[$j]] if $$aref[$i] > 2 * $$aref[$j]; + if ( $$aref[$i] > 2 * $$aref[$j] ) { + push @rp, [$$aref[$i], $$aref[$j]]; + } } } return @rp diff --git a/challenge-243/robbie-hatley/perl/ch-2.pl b/challenge-243/robbie-hatley/perl/ch-2.pl index cc410fa8b1..e19098da7b 100755 --- a/challenge-243/robbie-hatley/perl/ch-2.pl +++ b/challenge-243/robbie-hatley/perl/ch-2.pl @@ -43,6 +43,7 @@ Output: 49 PROBLEM NOTES: I'll use two three-part loops to sum all floors of pair quotients. + -------------------------------------------------------------------------------------------------------------- IO NOTES: Input is via either built-in variables or via @ARGV. If using @ARGV, provide one argument which must be a -- cgit