Need to Eliminate

Problem Statement

Find out max no. of adjacent set bits.


Input Format:

The first line contains an integer T, the number of test cases.

Each of the next T lines contains a binary string.

Constraints:

  • 1 <= T <= 10
  • The length of each binary string is between 5 and 10.
Sample Input
Sample Output

Solution

file_type_python count_of_family_members.py
for _ in range(int(input())):
    bin_str = input()
    print(max(map(len, bin_str.split('0'))))

Comments

Load Comments