2065B

Program

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
 
using namespace std;
 
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
 
    // Begin here
 
    return 0;
}
for x in range(int(input())):
    s=list(input())
    check=0
    for x in range(len(s)-1):
        if s[x]==s[x+1]: 
            check=1
            break
    print(1 if check==1 else len(s))

Comments

solution.cpp

  • Begin here