good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^3: Puzzle: Given an array of integers, find the best sequence of pop / shift...by reasonablekeith (Deacon) |
on Mar 20, 2006 at 11:36 UTC ( [id://537923]=note: print w/replies, xml ) | Need Help?? |
Nope, he's spot on. The decision player one gets to make is at the beginning.
imagine a 6 element list...
If you try this strategy on the example numbers the OP gave, you win by ten, which is as good as strategy in the OP's example code.
--- my name's not Keith, and I'm not reasonable.
In Section
Seekers of Perl Wisdom
|
|