← All problemsSign in

Crazy Subsequences

CodeChefRating 2111Open on judge ↗

Chef has a binary string $S$. He can modify it by choosing any subsequence of length $3$ from it and deleting the **first** and **last** character of the subsequence. For example, if $S = \textcolor{red}{11}01\textcolor{red}{0}1$, Chef can choose the subsequence marked in red and delete its first and last characters, obtaining the string $S = 1011$. Chef wonders what is the lexicographically lar

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