String Game
Alice and Bob are playing a game on a binary string $S$ of length $N$. Alice and Bob alternate turns, with Alice going first. On their turn, the current player must choose any index $1 \le i \lt |S|$ such that $S_i \neq S_{i+1}$ and erase either $S_i$ or $S_{i+1}$ from the string. This reduces the length of $S$ by one, and the remaining parts of $S$ are concatenated in the same order. The player
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