On February 19 2010 01:55 ieatkids5 wrote:
11111111
if all the denominations are the same, then just pick whatever
any other scenario, add up every other number starting at one end, then add up every other number starting from the other end. whichever side you start on that has a greater sum, start picking from that side.
example:
43472191
4+4+2+9=19
3+7+1+1=12
start picking from the side with the 4. your opponent has to take the 3 because if he takes the 1, then you will take the 9. after he takes the 3, take the 4. he will take the 7. take the 2. he takes the 1. you take the 9.
another example:
27261192
2+2+1+9=14
7+6+1+2=16
start from the right side and take the 2. your opponent will take the 9 because you will take it if he doesnt. take the 1. opponent will take next 1 because he cannot take the 2 on the left (or you will take the 7. take the 6. opponent takes the 2. take the 7.
edit - updated with examples
i assume you re-calculate these 2 values every time it is your turn?
edit
@onmach
which example shows inadequacy of your strategy? curious..