def hasVowel(strArr, queries):
vowels = {'a', 'e', 'i', 'o', 'u'}
def is_vowel_string(s):
return len(s) > 0 and s[0] in vowels and s[-1] in vowels
if not strArr or not queries:
return []
vowel_flags = [is_vowel_string(s) for s in strArr]
results = []
for query in queries:
try:
l, r = map(int, query.split('-'))
if l < 1 or r > len(strArr) or l > r:
results.append(0)
else:
results.append(sum(vowel_flags[l-1:r]))
except ValueError:
results.append(0)
return results
ZGVmIGhhc1Zvd2VsKHN0ckFyciwgcXVlcmllcyk6CiAgICB2b3dlbHMgPSB7J2EnLCAnZScsICdpJywgJ28nLCAndSd9CiAgICAKICAgIGRlZiBpc192b3dlbF9zdHJpbmcocyk6CiAgICAgICAgcmV0dXJuIGxlbihzKSA+IDAgYW5kIHNbMF0gaW4gdm93ZWxzIGFuZCBzWy0xXSBpbiB2b3dlbHMKCiAgICBpZiBub3Qgc3RyQXJyIG9yIG5vdCBxdWVyaWVzOgogICAgICAgIHJldHVybiBbXQoKICAgIHZvd2VsX2ZsYWdzID0gW2lzX3Zvd2VsX3N0cmluZyhzKSBmb3IgcyBpbiBzdHJBcnJdCiAgICByZXN1bHRzID0gW10KCiAgICBmb3IgcXVlcnkgaW4gcXVlcmllczoKICAgICAgICB0cnk6CiAgICAgICAgICAgIGwsIHIgPSBtYXAoaW50LCBxdWVyeS5zcGxpdCgnLScpKQogICAgICAgICAgICBpZiBsIDwgMSBvciByID4gbGVuKHN0ckFycikgb3IgbCA+IHI6CiAgICAgICAgICAgICAgICByZXN1bHRzLmFwcGVuZCgwKQogICAgICAgICAgICBlbHNlOgogICAgICAgICAgICAgICAgcmVzdWx0cy5hcHBlbmQoc3VtKHZvd2VsX2ZsYWdzW2wtMTpyXSkpCiAgICAgICAgZXhjZXB0IFZhbHVlRXJyb3I6CiAgICAgICAgICAgIHJlc3VsdHMuYXBwZW5kKDApCiAgICAKICAgIHJldHVybiByZXN1bHRz
YWFiLCBhLCBiY2QsIGF3ZSwgYmJiYmJ1CjItMywgNC01
aab, a, bcd, awe, bbbbbu
2-3, 4-5