One of my ideas was watching the value of sum and if it reached a negative value then break out of the inner loop.Until you get something like this.....
(I used to write test cases for my colleges CS club's High School programming contest).my @array = qw( -25 -3 -10 -30 -1 -2 -1 -4 -23 );
--MidLifeXis
In reply to Re: Largest Sum of Consecutive Integers
by MidLifeXis
in thread Largest Sum of Consecutive Integers
by OverlordQ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |