ABC Conjecture
You are given two strings $A$ and $B$, both of length $N$ and containing only the characters `a`, `b`, and `c`. In one move, you can modify string $A$ as follows: - Choose three indices $i, j, k$ ($1 \leq i \lt j \lt k \leq N$) such that $A_i = \texttt{a}, A_j = \texttt{b}, A_k = \texttt{c}$. That is, choose some [subsequence](https://en.wikipedia.org/wiki/Subsequence) of $A$ that is `abc`. -
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