← All problemsSign in

Merging Binary Strings

CodeChefRating 2318Open on judge ↗

You have two binary strings $A$ and $B$, both of length $N$. You have to merge both the binary strings to form a new binary string $C$ of length $2 \cdot N$. The relative order of characters in the original binary strings $A$ and $B$ should not change in the binary string $C$. For example, if $A = {\color{blue}01011}$ and $B = {\color{red}10100}$, one possible way to merge them to form $C$ is: $C

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start