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.
I don't really understand the solution here. For instance, if we put p1 tower height by 4, and p2 by 5, from the logics provided here, p2 wins. However, shouldn't p1 win in that tc?
2 evenly divides 4, so p1 -> 2. 1 is only integer that can evenly divide 5, so p2 has to go down to 1. Then p1 can go down to 1 from 2, right? in this case, p2 loses because it's height is already 1 if I understand the question correctly.
Could anyone confirm?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Tower Breakers
You are viewing a single comment's thread. Return to all comments →
Hi all,
I don't really understand the solution here. For instance, if we put p1 tower height by 4, and p2 by 5, from the logics provided here, p2 wins. However, shouldn't p1 win in that tc?
2 evenly divides 4, so p1 -> 2. 1 is only integer that can evenly divide 5, so p2 has to go down to 1. Then p1 can go down to 1 from 2, right? in this case, p2 loses because it's height is already 1 if I understand the question correctly.
Could anyone confirm?