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 agree that the question, as is tradition on this site, is very poorly written and clearly not by someone that speaks english natively.
The correct answer is not found in the Editorial, but is instead described pretty well on this SO answer.
In short, 'optimal' does boil down to mirroring, because in the case that the next player does not mirror, the first can also avoid mirroring to force the same end result by bringing the invariant back into line with their victory. Look into nim games if that is not clear.
The fact that this is ignored in the Editorial doesn't help the appearance of 'optimal' being an asinine definition of 'well just mirror because you can therefore its optimal'.
Without knowing about nim games or just brute forcing a big truth table, this is not an easy question and is a pretty poor way to gauge understanding. Probably why it's tagged 'observation', they want you to just guess the correct answer based on simulating a few cases.
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 →
I agree that the question, as is tradition on this site, is very poorly written and clearly not by someone that speaks english natively.
The correct answer is not found in the Editorial, but is instead described pretty well on this SO answer.
In short, 'optimal' does boil down to mirroring, because in the case that the next player does not mirror, the first can also avoid mirroring to force the same end result by bringing the invariant back into line with their victory. Look into nim games if that is not clear.
The fact that this is ignored in the Editorial doesn't help the appearance of 'optimal' being an asinine definition of 'well just mirror because you can therefore its optimal'.
Without knowing about nim games or just brute forcing a big truth table, this is not an easy question and is a pretty poor way to gauge understanding. Probably why it's tagged 'observation', they want you to just guess the correct answer based on simulating a few cases.