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
|
115 Discussions
|
Please Login in order to post a comment
My Javascript solution
If you are here because the discription doesn't match the results, you gotta consider that a tower can be reduced directly to 1. example:
2 towers of height 7
p1: 7 -> 1 (x=1 y=6 -> x divides y)
p2: 7 -> 1 (x=1 y=6 -> x divides y)
p1 loses
p2 wins, therefore returns p2
the description says that y should divide x but in reality x should divide y
Please fix that description
Solution that worked for me with an assumption that player 2 always mirrors player 1's moves:(if someone understands why we should assume that please explain)
if (m == 1) { return 2; }
no need to tell you how awful this problem description was, they even gave a contradicting example with the description of the "rules",