HackerRank ‘Game of Stones’ Solution

Short Description:

There are two players in game P1 and P2 and the condition of the game is like that any player can take stone from {2,3,5} set and p1 is the first player to move and then p2 and so on.If player is unable to move the player lose the game. youu need to find who wins the game for given test cases.

Problem statement is here :  Game of Stones

Solution is here

Capture

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s