Increase One
CodeChefOpen on judge ↗
You are given a binary string S = S1S2...AN. That is, the strong consists only of 0s and 1s. Your aim is to have more numer of 1s in the string than the number of 0s. To do so, you are allowed to make some Operations. In a single Operation, you can pick any 1 in the string which hasn't been picked so far, and if there is a 0 adjacent to it (on either side), you can pick at most one of those 0s, a
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