BETA
School Problem's Submission isn't counted in score!

Submissions: 519 Accuracy:

31.6%

Split the string
     

Given a string S, the task is to check if we can split it into 4 string such that each string is non-empty and different from each other.

Examples:

Input : S[] = "geeksforgeeks"
Output : 1
"geeks", "for", "gee", "ks" are four 
distinct strings that can form from
given string.

Input : S[] = "aaabb"
Output : 0


Input:
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains a string S.

Output:
For each test case in a new line print 1 if the string could be splitted else print a 0.

Constraints:
1<=T<=200
1< |S| <=1000

Example:
Input:

2
geeksforgeeks
aaabb
Output:
1
0

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

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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