LCS of '0' K Repeated String
Easy Accuracy: 28.99% Submissions: 856 Points: 2

Given a Binary string and a number k. our task is to find the Longest continuous sequence of '0' after repeating Given string K time. 

Input: the First line of input contains an integer T  i.e number of a test case. each test case contains a number K and a  Binary String. 
Output:

print an integer i.e Longest continuous sequence of 0

Constraints:

1<= T <= 100
1<= S <= 10^5

1 <= K <= 10^5

Example:

Input :
2
3
100001
4
0100011

output :
4
3

explanation :
testcase 1 : After repeating given string  3 time, string :=  100001100001100001 , now LCS : 4 

 

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.