diff options
| author | Mohammad Sajid Anwar <Mohammad.Anwar@yahoo.com> | 2024-07-07 12:32:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-07 12:32:10 +0100 |
| commit | 87817ec72c8c4955821cd97dabfaab8b3a935d4e (patch) | |
| tree | 8653b4e825ca21bd2ef350a8bd34beb43772835a | |
| parent | 8102cae0ddb2398dd16d7e47e30a4cd069e72a62 (diff) | |
| parent | f398971421d9c5dad7d3b45aac75458893f14d8a (diff) | |
| download | perlweeklychallenge-club-87817ec72c8c4955821cd97dabfaab8b3a935d4e.tar.gz perlweeklychallenge-club-87817ec72c8c4955821cd97dabfaab8b3a935d4e.tar.bz2 perlweeklychallenge-club-87817ec72c8c4955821cd97dabfaab8b3a935d4e.zip | |
Merge pull request #10374 from robbie-hatley/rh276
Changed for loops in 276-1 from three-part to ranged.
| -rwxr-xr-x | challenge-276/robbie-hatley/perl/ch-1.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/challenge-276/robbie-hatley/perl/ch-1.pl b/challenge-276/robbie-hatley/perl/ch-1.pl index 560b9ba3f4..555b5cc726 100755 --- a/challenge-276/robbie-hatley/perl/ch-1.pl +++ b/challenge-276/robbie-hatley/perl/ch-1.pl @@ -53,8 +53,8 @@ Output is to STDOUT and will be each input followed by the corresponding output. use v5.38; sub complete_days (@times) { my $cds = 0; - for ( my $i = 0 ; $i <= $#times - 1 ; ++$i ) { - for ( my $j = $i + 1 ; $j <= $#times - 0 ; ++$j ) { + for my $i ( 0 .. $#times - 1 ) { + for my $j ( $i + 1 .. $#times - 0 ) { 0 == ($times[$i]+$times[$j])%24 and ++$cds; } } |
