Skip to content

Commit b3ab6d0

Browse files
authoredMar 19, 2023
Create 2586. Count the Number of Vowel Strings in
1 parent f160c15 commit b3ab6d0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
class Solution {
2+
public:
3+
int isvowel(char c)
4+
{
5+
return c=='a' || c=='e' || c=='i' || c=='o' || c=='u';
6+
}
7+
int vowelStrings(vector<string>& words, int left, int right) {
8+
int ans=0;
9+
for(int i=left; i<=right; i++)
10+
{
11+
if(isvowel(words[i][0]) && isvowel(words[i][words[i].size()-1]))
12+
ans++;
13+
}
14+
return ans;
15+
}
16+
};

0 commit comments

Comments
 (0)
Please sign in to comment.