diff options
| author | Avery Adams <oldtechaa@gmail.com> | 2023-03-31 08:20:29 +1300 |
|---|---|---|
| committer | Avery Adams <oldtechaa@gmail.com> | 2023-03-31 08:20:29 +1300 |
| commit | faf0518fdd1805ab468bf26d5017975202110e8c (patch) | |
| tree | 057f793b00e8bb6535979fe0e0694b9490d592b8 | |
| parent | 077442285848686130c6a97b9bb61b4ac2a061de (diff) | |
| download | perlweeklychallenge-club-faf0518fdd1805ab468bf26d5017975202110e8c.tar.gz perlweeklychallenge-club-faf0518fdd1805ab468bf26d5017975202110e8c.tar.bz2 perlweeklychallenge-club-faf0518fdd1805ab468bf26d5017975202110e8c.zip | |
Fix bug in opposite set.
| -rw-r--r-- | challenge-210/avery-adams/perl/ch-2.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-210/avery-adams/perl/ch-2.pl b/challenge-210/avery-adams/perl/ch-2.pl index 41803073d4..2610085fb3 100644 --- a/challenge-210/avery-adams/perl/ch-2.pl +++ b/challenge-210/avery-adams/perl/ch-2.pl @@ -12,7 +12,7 @@ for (my $index = 0; $index < $#list; $index++) { $index--; } elsif ($collision == 0) { splice @list, $index, 2; - $index--; + $index -= 2; } elsif (0 > $collision > $list[$index + 1]) { splice @list, $index, 1; for (my $index2 = $index - 1; $index2 >= 0 and $list[$index2] > 0; $index2--) { |
