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 win On Saturday, 12 January 2013 19:12:19 UTC+5:30, raunak wrote: > > > how is winning going to decided > > On Sat, Jan 12, 2013 at 6:33 PM, siva <[email protected] > <javascript:>>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 players play optimally. >> >> i) Given N,tell whether the 1st player win or loss ? >> >> ii) If player 1 wins, how many balls he should take at this first >> turn(1 or 2) ? >> >> -- >> >> >> > > --
