First Player can always win.

For each heap
   Pick heap-size - 1 coins if this is not the n-1th heap
   Pick all coins from the heap if this the n-1th heap.

Please correct me if i am wrong.

Thanks,
Immanuel

On Wed, Jun 15, 2011 at 3:13 PM, Piyush Sinha <ecstasy.piy...@gmail.com>wrote:

> *There are n heaps of coin(numbered from 0 to n-1) with atleast 1 coin in
> each heap. There are 2 players. First player can pick any no. of coins from
> the least numbered heap, then the second player can pick any no. of coins
> from the least numbered heap. Unless it is emptied, the player cant move on
> to the next heap. The player who picks the last coin wins. Design an
> algorithm for predicting the winner.*
>
>
> --
> *Piyush Sinha*
> *IIIT, Allahabad*
> *+91-8792136657*
> *+91-7483122727*
> *https://www.facebook.com/profile.php?id=100000655377926 *
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to