in reply to Re^2: Find Length Of Longest Ascending/Descending Sequence
in thread Find Length Of Longest Ascending/Descending Sequence
Capturing in one go will return qw(123 56 543) instead of qw(123 56 6543);
Which isn't a problem when you just want the length. The result is 1 more than the length of the longest capture. That's why I increment $longest at the end.
...or rather, that's why I was planning on incrementing $longest at the end. Fixed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Find Length Of Longest Ascending/Descending Sequence
by wind (Priest) on May 09, 2011 at 21:57 UTC | |
by ikegami (Patriarch) on May 09, 2011 at 23:05 UTC | |
by wind (Priest) on May 09, 2011 at 23:33 UTC |