Distinct Representations
You're given a binary string $S$, i.e. a string consisting of only the characters $0$ and $1$. You can modify it by performing the following operation: - Choose an index $i$ ($1 \leq i \leq N-3$) such that $S_i = S_{i+2}$, $S_{i+1} = S_{i+3}$, and $S_i \neq S_{i+1}$. Then, swap $S_{i+1}$ and $S_{i+2}$. Or, more simply, you can choose a substring equal to $\text{0101}$ and make it $\text{0011}$
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