We’ll say a string is nice if at least two of the following conditions are satisfied:
- It doesn’t contain substrings bu, ba or be;
- It contains at least three vowels (vowels are a, e, i, o and u);
- It contains a double letter (at least two similar letters following one another), like b in “abba”.
Your task is to check whether a given string is nice. Strings for this task will consist of lowercase letters only. Note that for the purpose of this task, we don’t consider ‘y’ as a vowel.
“bac” isn’t nice. No conditions are satisfied: it contains a ba substring, contains only one vowel and no doubles.
“aza” isn’t nice. Only the first condition is satisfied, but the string doesn’t contain enough vowels or doubles.
“abaca” isn’t nice. The second condition is satisfied: it contains three vowels a, but the other two aren’t satisfied: it contains ba and no doubles.
“baaa” is nice. The conditions #2 and #3 are satisfied: it contains three vowels a and a double a.
“aaab” is nice, because all three conditions are satisfied.