[algogeeks] Amazon Dynamic Programming problem

2013-01-12 Thread siva
consider there are N balls in a basket. 2 players play the turns alternatively ..AT each turn,the player can take 1 or 2 balls from the basket. the first player starts the game.. Both the players play optimally. i) Given N,tell whether the 1st player win or loss ? ii) If player 1

Re: [algogeeks] Amazon Dynamic Programming problem

2013-01-12 Thread Raunak Gupta
how is winning going to decided On Sat, Jan 12, 2013 at 6:33 PM, siva sivavikne...@gmail.com wrote: consider there are N balls in a basket. 2 players play the turns alternatively ..AT each turn,the player can take 1 or 2 balls from the basket. the first player starts the game.. Both the

Re: [algogeeks] Amazon Dynamic Programming problem

2013-01-12 Thread vamshi palakurti
Are we supposed to assume that every ball played is a hit? Or should we consider a hit or a fail case?? On Sat, Jan 12, 2013 at 7:12 PM, Raunak Gupta raunak.gupt...@gmail.comwrote: how is winning going to decided On Sat, Jan 12, 2013 at 6:33 PM, siva sivavikne...@gmail.com wrote: consider

Re: [algogeeks] Amazon Dynamic Programming problem

2013-01-12 Thread siva
The player who plays the last turn and finishes the game wins ... I think the approach would be similar to this .. http://www.spoj.com/problems/TWENDS/ .. @vamshi .. Can't get your question? .. what you refer to hit or fail case in picking up a ball?.. At the end any of the 2 players can