A festival issues entry wristbands whose code is a single string made only of English letters (uppercase or lowercase), always with an even number of characters. Split a wristband's code exactly down the middle into a first half and a second half of equal length. Count how many vowel letters — 'a', 'e', 'i', 'o', 'u', in either uppercase or lowercase — appear in each half. A wristband qualifies for the VIP raffle when both halves contain exactly the same number of vowels. Given one wristband code, determine whether it qualifies.
A single line containing the wristband code s, a string of letters only.
Print true if the two halves contain the same number of vowels, or false otherwise.
Example 1
Input
Twilight
Expected
true
Explanation
The 8-character code splits into "Twil" and "ight". "Twil" contains 1 vowel (i). "ight" contains 1 vowel (i). Both halves have exactly 1 vowel, so the wristband qualifies. Output: true.
Example 2
Input
Umbrella
Expected
false
Explanation
The 8-character code splits into "Umbr" and "ella". "Umbr" contains 1 vowel (U). "ella" contains 2 vowels (e, a). The counts differ (1 vs 2), so the wristband does not qualify. Output: false.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →