Skip to content

Commit 04dd057

Browse files
authored
Create
1 parent b686ada commit 04dd057

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Time: O(n)
2+
# Space: O(1)
3+
4+
# string
5+
class Solution(object):
6+
def vowelStrings(self, words, left, right):
7+
"""
8+
:type words: List[str]
9+
:type left: int
10+
:type right: int
11+
:rtype: int
12+
"""
13+
VOWELS = {'a', 'e', 'i', 'o', 'u'}
14+
return sum(words[i][0] in VOWELS and words[i][-1] in VOWELS for i in xrange(left, right+1))

0 commit comments

Comments
 (0)