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.
- Tower Breakers
- Discussions
Tower Breakers
Tower Breakers
Sort by
recency
|
48 Discussions
|
Please Login in order to post a comment
My rust solution:
Poor case! How come every case has m=1 except for the first and the last cases!
Game sounds like Cups from FRIENDS:
def towerBreakers(n, m):
This game is equivalent to a "normal game of Nim" (https://en.wikipedia.org/wiki/Nim) starting with n heaps each having an initial size equal to the sum of the exponents in the factorization of m. It just so happens that a very terse simplified solution exists for n heaps of the same initial size, but that is not trivial to prove. I doubt the authors realize the complexity of this puzzle, when done right.
This is such a poorly worded question becuase it says "1 <= y < x" which means m must be larger than 1. But you actually need to consider the case where m == 1.