Computer Science, asked by humeranaaz0403, 8 months ago

You are given a binary string S. In a single operation, you can choose
two indices L and R such that 1 sl <RN and complement the
characters between L and Rice SL, SL+1, ..., SR. By complement, we
mean change character 0 to 1 and vice-versa.
You task is to perform ATMOST one operation such that in final string
number of 1s is maximised. If there is no need to completement, i.e.,
string contains all 1s, return-1. Else, return the two values denoting L
and R. If there are multiple solutions, return the lexicographically
smallest pair of Land R.
Input:
The first line of input contains an integer T denoting the number of test
cases!
Each test case consist of a length of string N and the next line contains
the string S in 'lowercase only.
Output:
Print the value L and R with space between then in a seprate line if it
exists else print -1.
Constraints:
1 <T<40
1 *N<100
1s<100

in phyton​

Answers

Answered by Anonymous
2

Answer:

sorry to say but I can't understand your question

Answered by chetna2182
4

Answer:

Hy dear plz follow me plzz

Similar questions