Problem of the day
You are given, ‘str’= ‘codingninjas’, when we split this string we get, ‘coding’ and ‘ninjas’ which both contain 2 vowels each. Hence the answer is ‘True’.
The first line of input contains a single integer ‘T’, representing the number of test cases.
The first line of each test case contains a string ‘str’ representing the given string.
For each test case, print a "True” or “False" depending on if the halves of the string have an equal number of vowels or not.
Print a separate line for each test case.
1 <= T <= 10
1 <= |str| <= 10^6
‘str’ will contain upper and lower case characters of the English alphabet.
|str| is even.
Time Limit: 1 sec.
You do not need to print anything. It has already been taken care of. Just implement the given function.
2
codingninjas
helloworld
True
False
For the first test case, ‘str’= ‘codingninjas’, when we split this string we get, ‘coding’ and ‘ninjas’ which both contain 2 vowels each. Hence the answer is ‘True’.
For the second test case, ‘str’= ‘helloworld’, when we split this string we get ‘hello and ‘world’, which contain 2 and 1 vowels respectively. Hence the answer is ‘False’.
2
Aa
AbbaaA
True
False