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.
Hi Sergio, I don't understand your question. If the first second and fourth values are between 2^62 and 2^63, I don't believe that guarantees that their output values should be equal. Or put another way, that the winner will always be Richard or Louise based on which power of 2 the input number falls between.
Remember, the problem definition says that if N is not a power of 2, reduce it by the next largest power of 2 less than N.
So in your example, the largest power of 2 less than the first, second and fourth values would be 2^62.
The winner will then be determined on the basis of the difference between input value and 2^62.
So yes, the winner of the counter game could (and should) be different for the values that you mentioned.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Counter game
You are viewing a single comment's thread. Return to all comments →
Hi Sergio, I don't understand your question.
If the first second and fourth values are between 2^62 and 2^63, I don't believe that guarantees that their output values should be equal. Or put another way, that the winner will always be Richard or Louise based on which power of 2 the input number falls between.
Remember, the problem definition says that if N is not a power of 2, reduce it by the next largest power of 2 less than N. So in your example, the largest power of 2 less than the first, second and fourth values would be 2^62. The winner will then be determined on the basis of the difference between input value and 2^62.
So yes, the winner of the counter game could (and should) be different for the values that you mentioned.