LCS of '0' K Repeated String
Submissions: 647   Accuracy:

28.3%

  Difficulty: Easy   Marks: 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 

 

** For More Input/Output Examples Use 'Expected Output' option **

Author: Nishant_Singh


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.