Keep It Simple, Stupid | |
PerlMonks |
Re^3: Puzzle: Longest Increasing Sequenceby kaif (Friar) |
on Apr 16, 2006 at 17:10 UTC ( [id://543661]=note: print w/replies, xml ) | Need Help?? |
Well, no, you only need to keep at most one increasing subsequence for each length.
In your example, you can forget about the 9, 7, 5, and 3 entirely. Any increasing subsequence beginning with them will be just as long if they begin with the 1 instead.
In Section
Seekers of Perl Wisdom
|
|