You are given a binary string of length . Where a character at position signifies the signal level of an antenna at second.
represents low signal and represents high signal.
What is the maximum consecutive time(in seconds) for which the signal was high?
Function Description
Complete the function solve provided in the editor. This function takes the following one parameter and returns the required answer:
: the size of the binary string.
: the binary string.
Input Format
Note: This is the input format that you must use to provide custom input (available above the Compile and Test button).
The first line contains denoting the number of test cases. also specifies the number of times you have to run the solve function on a different set of inputs.
For each test case:
Output Format
For each test case, print the answer in a new line.
Constraints
Code snippets (also called starter code/boilerplate code)
This question has code snippets for C, CPP, Java, and Python.
Signal was high during last 3 second for the longest consecutive time. Thus the answer is 3.