2062. Count Vowel Substrings of a String Easy

@problem@discussion
#Hash Table#String



1/**
2 * [2062] Count Vowel Substrings of a String
3 *
4 * A substring is a contiguous (non-empty) sequence of characters within a string.
5 * 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.
6 * Given a string word, return the number of vowel substrings in word.
7 *  
8 * Example 1:
9 * 
10 * Input: word = "aeiouu"
11 * Output: 2
12 * Explanation: The vowel substrings of word are as follows (underlined):
13 * - "<u>aeiou</u>u"
14 * - "<u>aeiouu</u>"
15 * 
16 * Example 2:
17 * 
18 * Input: word = "unicornarihan"
19 * Output: 0
20 * Explanation: Not all 5 vowels are present, so there are no vowel substrings.
21 * 
22 * Example 3:
23 * 
24 * Input: word = "cuaieuouac"
25 * Output: 7
26 * Explanation: The vowel substrings of word are as follows (underlined):
27 * - "c<u>uaieuo</u>uac"
28 * - "c<u>uaieuou</u>ac"
29 * - "c<u>uaieuoua</u>c"
30 * - "cu<u>aieuo</u>uac"
31 * - "cu<u>aieuou</u>ac"
32 * - "cu<u>aieuoua</u>c"
33 * - "cua<u>ieuoua</u>c"
34 * 
35 *  
36 * Constraints:
37 * 
38 * 	1 <= word.length <= 100
39 * 	word consists of lowercase English letters only.
40 * 
41 */
42pub struct Solution {}
43
44// problem: https://leetcode.com/problems/count-vowel-substrings-of-a-string/
45// discuss: https://leetcode.com/problems/count-vowel-substrings-of-a-string/discuss/?currentPage=1&orderBy=most_votes&query=
46
47// submission codes start here
48
49impl Solution {
50    pub fn count_vowel_substrings(word: String) -> i32 {
51        0
52    }
53}
54
55// submission codes end
56
57#[cfg(test)]
58mod tests {
59    use super::*;
60
61    #[test]
62    fn test_2062() {
63    }
64}
65


Back
© 2025 bowen.ge All Rights Reserved.