[algogeeks] Re: DE Shaw Q

2011-06-15 Thread L
The ordering of coins matter for this problem. For ex. 1 2 and 2 1 have different results. So, i don't think that there would be a direct formula for this problem. We will have to traverse all the heaps of coins determining whether the current player is in winning or losing position. On Jun 15,

Re: [algogeeks] Re: DE Shaw Q

2011-06-15 Thread Srinivasa Rao
Lets say: Player1 picking first. x : number of continuous heaps which contains only one coin at the start. Ex. 1,2,3,1,4 (x = 1) 1,1,2,3 (x = 2) 2,1,3,4,5 ( x= 0) case 1: x is even ( Player1 wins) case 2: x is odd (Player2 wins) correct me if i am wrong On 15 June 2011 19:10, L

Re: [algogeeks] Re: DE Shaw Q

2011-06-15 Thread romil bansal
i think it can be done by counting the no of starting heaps with 1 coins in it before any heap with coin1 in it. if all the heaps have only one coin that player1 win if heap%2==1 if there is any heap with 1 then player1 win if (starting heap with 1 coin in them)%2==0. eg player 1 win in case 1 of