Shift Game
Alice is given two binary strings $A$ and $B$, each of length $N$. A binary string is a string consisting only of the characters `0` and `1`. Alice plays the following game: Initially, her score is $0$. In each iteration: - She adds the product of the first characters of the current strings to her score. That is, she adds $A_1 \cdot B_1$ to the score. - If $A_1 = B_1$, she replaces $A$ with
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start