We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Game Theory
- Tower Breakers
- Discussions
Tower Breakers
Tower Breakers
Sort by
recency
|
106 Discussions
|
Please Login in order to post a comment
In the first case (n=2, m=2), Player 2 wins since Player 2 can mirror Player 1's moves. In the second case (n=1, m=4), Player 1 wins by reducing the tower height optimally, forcing Player 2 to lose.
hello guys mai apka apna salil singh
int towerBreakers(int n, int m) { if((m==1)||(n%2==0)) return 2; else return 1;
}
Why don't you try https://avatarworldmodapk.pro
The way I see it, the second test case is wrong. 1 tower of 7 pieces. If players do the optimal play, the game would go like this:
Same with the second one. 3 tower of 7 pieces. Player 2 forces P1 to take the first piece from each tower and Player 2 will win.