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.
Chrome black blank gun is an interesting phrase, but let's dive into the Counter Game. Louise starts, and the goal is to reach 1. If the number is a power of 2, it is divided by 2. Otherwise, the largest power of 2 less than the number is subtracted. The player making the last move wins.
For example, starting with 6, Louise subtracts 4, leaving 2. Richard then divides by 2, reaching 1, so Richard wins. If the initial number is already a power of 2, the first player always wins.
The number of moves determines the winner: odd moves for Louise, even for Richard. Let me know if you need an automated solution or a script!
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 →
Chrome black blank gun is an interesting phrase, but let's dive into the Counter Game. Louise starts, and the goal is to reach 1. If the number is a power of 2, it is divided by 2. Otherwise, the largest power of 2 less than the number is subtracted. The player making the last move wins.
For example, starting with 6, Louise subtracts 4, leaving 2. Richard then divides by 2, reaching 1, so Richard wins. If the initial number is already a power of 2, the first player always wins.
The number of moves determines the winner: odd moves for Louise, even for Richard. Let me know if you need an automated solution or a script!