← All problemsSign in

01 Subsequence

CodeChefRating 1781Open on judge ↗

You are handed a binary string $S$, but not in any ordinary form. Instead of being directly given the value of $S$, you are given an array $C$ of size $N$ representing the *01-compression representation* of $S$. This means $S$ first contains $C_1$ $\texttt{0}$ characters, then $C_2$ $\texttt{1}$ characters, then $C_3$ $\texttt{0}$ characters, and so on. For example, the array $C = [2, 3, 4, 3]$ co

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