aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Smith <js5@sanger.ac.uk>2021-08-30 11:39:50 +0100
committerJames Smith <js5@sanger.ac.uk>2021-08-30 11:39:50 +0100
commit4c23a8c701474e86017438e4b50134270322b320 (patch)
treeeb293cb11c283673c62a287b6c1312d9bb6f5ca1
parentf2d64b2a58b676cc8ec2231c2b9d2ab6fb4c18bf (diff)
downloadperlweeklychallenge-club-4c23a8c701474e86017438e4b50134270322b320.tar.gz
perlweeklychallenge-club-4c23a8c701474e86017438e4b50134270322b320.tar.bz2
perlweeklychallenge-club-4c23a8c701474e86017438e4b50134270322b320.zip
Tidy up
-rw-r--r--challenge-128/james-smith/perl/ch-1.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-128/james-smith/perl/ch-1.pl b/challenge-128/james-smith/perl/ch-1.pl
index bd121f5026..6db18f8378 100644
--- a/challenge-128/james-smith/perl/ch-1.pl
+++ b/challenge-128/james-smith/perl/ch-1.pl
@@ -47,10 +47,10 @@ sub find_empty {
my $max_area = [0,0,0];
foreach my $x ( 0..$w ) {
foreach my $y ( 0..$h ) {
- next unless $runs[$y][$x]; ## Short cut answer will be 0
+ next unless $runs[$y][$x]; ## Short cut answer will be 0
my $max_w = 1e9;
foreach my $j ( $y..$h ) {
- last unless $runs[$j][$x]; ## Short cut all subsequent answers will zero
+ last unless $runs[$j][$x]; ## Short cut all subsequent answers are 0
$max_w = $runs[$j][$x] if $runs[$j][$x] < $max_w;
my $area = $max_w * ($j-$y+1);
$max_area = [$area,$max_w,$j-$y+1] if $area>$max_area->[0];