You are viewing a single comment's thread. Return to all comments →
Gaurav, the logic needs to be modified. While N is not power of 2, both players reduce N by power of 2 (not to power of 2).
For example, if N=15, Louise will reduce N by 8 to get N=7, which is not power of 2.
Another issue is that number of turns is not related to binary-length of number. Please try to run few examples using the logic, you'll surely get it.
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 →
Gaurav, the logic needs to be modified. While N is not power of 2, both players reduce N by power of 2 (not to power of 2).
For example, if N=15, Louise will reduce N by 8 to get N=7, which is not power of 2.
Another issue is that number of turns is not related to binary-length of number. Please try to run few examples using the logic, you'll surely get it.