2586. Count the Number of Vowel Strings in Range Poison 2023-11-07 1234567891011121314151617class Solution { private static final Set<Character> VOWEL_CHAR_SETS = new HashSet<>(Arrays.asList('a', 'e', 'i', 'o', 'u')); public int vowelStrings(String[] words, int left, int right) { int count = 0; for (int i = left; i <= right; i++) { if (ifVowelString(words[i])) { count++; } } return count; } private boolean ifVowelString(String word) { return VOWEL_CHAR_SETS.contains(word.charAt(0)) && VOWEL_CHAR_SETS.contains(word.charAt(word.length() - 1)); }} References2586. Count the Number of Vowel Strings in Range