aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-106/cheok-yin-fung/perl/ch-1.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-106/cheok-yin-fung/perl/ch-1.pl b/challenge-106/cheok-yin-fung/perl/ch-1.pl
index 31d753c32b..f3b27f3a68 100644
--- a/challenge-106/cheok-yin-fung/perl/ch-1.pl
+++ b/challenge-106/cheok-yin-fung/perl/ch-1.pl
@@ -29,7 +29,7 @@ sub max_ind {
sub selection_sort {
swap_arr_N(0, max_ind(@N));
- for my $i (1..$#N-1) {
+ for my $i (1..$#N) {
swap_arr_N($i, $i+max_ind(@N[$i..$#N]));
my $dif = $N[$i-1] - $N[$i];
$max_dif = $dif if $dif > $max_dif;