Good or Bad string
Submissions: 6747   Accuracy:

29.85%

  Difficulty: Basic   Marks: 1

In this problem, a String S is composed of lowercase alphabets and wildcard characters i.e. '?'. Here, '?' can be replaced by any of the lowercase alphabets. Now you have to classify the given String on the basis of following rules:

If there are more than 3 consonants together or more than 5 vowels together, the String is considered to be "BAD". A String is considered "GOOD" only if it is not “BAD”.

NOTE: String is considered as "BAD" if the above condition is satisfied even once. Else it is "GOOD" and the task is to make the string "BAD".

Input:
The first line consists of an integer T i.e number of test cases. T testcases follow. The first and only line of each test case consists of a string S

Output:
For each testcase, in a new line, print "1"  if string is GOOD, else print "0".

Constraints: 
1 <= T <= 100
1 <= |S| <= 100

Example:
Input:

2
aeioup??
bcdaeiou??
Output:
1
0

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

Contributor: Saksham Ashtputre
Author: deactjustCalvin


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.