In this post, we will solve the Tower Breakers Jumps HackerRank Solution. This problem (Tower Breakers) is a part of the HackerRank Problem Solving series.
Two players are playing a game of Tower Breakers! Player 1 always moves first, and both players always play optimally.The rules of the game are as follows:
- Initially there are n towers.
- Each tower is of height m.
- The players move in alternating turns.
- In each turn, a player can choose a tower of height x and reduce its height to y, where and evenly divides .
- If the current player is unable to make a move, they lose the game.
Given the values of and , determine which player will win. If the first player wins, return . Otherwise, return.