← All problemsSign in

Maximise The Minimum

CodeChefRating 2764Open on judge ↗

You are given a **binary** string $S$ of length $N$. Let $F(X)$ denote the length of **longest non-decreasing** [subsequence](https://en.wikipedia.org/wiki/Subsequence) of the binary string $[X_1, X_2, \ldots, X_{|X|}]$. Your task is to partition $S$ into two disjoint non-empty subsequences, $S_1$ and $S_2$, such that $\min(F(S_1),F(S_2))$ is as large as possible. Find the maximum value of $\

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