http://qs321.pair.com?node_id=537928


in reply to Re^4: Puzzle: Given an array of integers, find the best sequence of pop / shift...
in thread Puzzle: Given an array of integers, find the best sequence of pop / shift...

Yes, shifting and popping will change the index. However, the point the OP is trying to make is that the player who starts first can force the second player to take all evens or all odds from the original layout. With this ability, the first player can total the two possibilities and decide the outcome before the game even starts. Quite clever.

Dave