diff options
| -rwxr-xr-x | challenge-192/perlboy1967/perl/ch-2.pl | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/challenge-192/perlboy1967/perl/ch-2.pl b/challenge-192/perlboy1967/perl/ch-2.pl index 49f56eda22..8404b5449b 100755 --- a/challenge-192/perlboy1967/perl/ch-2.pl +++ b/challenge-192/perlboy1967/perl/ch-2.pl @@ -49,12 +49,10 @@ sub equalDistribution { return -1 if ($sum % $n != 0); - my $avg = $sum/$n; - my $m = 0; while (1) { my ($min,$max) = minmax(@_); - last if ($max == $avg); + last if ($min == $max); $m++; |
