Perl-Sensitive Sunglasses | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hang about.....
If you are shifting and popping, aren't the indices going to change as you go? Well, actually - only as you shift. That is, each time you shift an element off the list, the index of each remaining element is reduced by one - no? Therfore, this whole odds/evens thing won't work at all - or have I been smoking too much happy weed? ;) (just kidding - I never touch the stuff ;) In reply to Re^4: Puzzle: Given an array of integers, find the best sequence of pop / shift...
by McDarren
|
|