carloscn / carloscn/structstudy

leetcode2062: Count Vowel Substrings of a String

Open
#332 2 comments 0 reactions 1 assignee Claimed by @carloscn View on GitHub
Lang-rust Level-easy 一般问题 字符串 查找
Dominant language
C
Stars
4
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### Description

A substring is a contiguous (non-empty) sequence of characters within a string.

A vowel substring is a substring that only consists of vowels ('a', 'e', 'i', 'o', and 'u') and has all five vowels present in it.

Given a string word, return the number of vowel substrings in word.


Example 1:

Input: word = "aeiouu"
Output: 2
Explanation: The vowel substrings of word are as follows (underlined):
- "**aeiou**u"
- "**aeiouu**"

Example 2:

Input: word = "unicornarihan"
Output: 0
Explanation: Not all 5 vowels are present, so there are no vowel substrings.

Example 3:

Input: word = "cuaieuouac"
Output: 7
Explanation: The vowel substrings of word are as follows (underlined):
- "c**uaieu**ouac"
- "c**uaieuo**uac"
- "c**uaieuou**ac"
- "c**uaieuoua**c"
- "cu**aieuo**uac"
- "cu**aieuou**ac"
- "cu**aieuoua**c"

Constraints:

1 <= word.length <= 100
word consists of lowercase English letters only.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.