← All problemsSign in

Maximum Zeros

You have a binary string (a string contains only ones and zeros) Define: - F(s)=Z(s)-O(s) - Z(s)=number of zeros in s - O(s)=number of ones in s You want to find l and r such that F(s[l:r]) maximum possible and s[l:r] is its substring starting from l to r Input The first line conatins integer N which is the string size Then a string of size N contains only zeros and ones Outoput The firs

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