aboutsummaryrefslogtreecommitdiff
path: root/challenge-257
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2024-02-21 19:19:13 +0000
committerGitHub <noreply@github.com>2024-02-21 19:19:13 +0000
commit2cab60c3897e48af340150e0ec47dff772c0b38c (patch)
tree013e7b7639dbd8b00025bd1bdbdf970d011027d5 /challenge-257
parent71c2c9118ec22d3f4c0e35aac804d25e52b0599b (diff)
parent759a8bd8507e025cda6142c6bbbfb652d0af290e (diff)
downloadperlweeklychallenge-club-2cab60c3897e48af340150e0ec47dff772c0b38c.tar.gz
perlweeklychallenge-club-2cab60c3897e48af340150e0ec47dff772c0b38c.tar.bz2
perlweeklychallenge-club-2cab60c3897e48af340150e0ec47dff772c0b38c.zip
Merge pull request #9624 from mattneleigh/pwc257
modified: challenge-257/mattneleigh/perl/ch-2.pl
Diffstat (limited to 'challenge-257')
-rwxr-xr-xchallenge-257/mattneleigh/perl/ch-2.pl9
1 files changed, 3 insertions, 6 deletions
diff --git a/challenge-257/mattneleigh/perl/ch-2.pl b/challenge-257/mattneleigh/perl/ch-2.pl
index 0b70ccff13..28d1cddd68 100755
--- a/challenge-257/mattneleigh/perl/ch-2.pl
+++ b/challenge-257/mattneleigh/perl/ch-2.pl
@@ -129,12 +129,9 @@ sub matrix_in_rref{
);
# See if anything else in this column isn't a
- # zero... use alternate row coordinate $J
- for my $J (0 .. $#$matrix){
- # Skip the current row
- next
- if($J == $j);
-
+ # zero... use alternate row coordinate $J,
+ # skipping the current row $j
+ for my $J ((0 .. ($j - 1)), (($j + 1) .. $#$matrix)){
# If something else in this column isn't zero,
# we aren't in RREF
return(0)