My issue
Binary substring
i have a problem understanding a testcase
input:
1
8
00100011
output:
7
in this acc. to the question we can select i and j where i<j and swap the i to j and i+1 to j+1.
in this situation if we select i = 2 and j = 5 then the non-decreasing substring string produced would be 00000111 and the output should have been 8.
so why is it 7, am i missing any key part.
Problem Link: https://www.codechef.com/problems/BIS