Class Solution
java.lang.Object
g2001_2100.s2062_count_vowel_substrings_of_a_string.Solution
2062 - Count Vowel Substrings of a String.<p>Easy</p>
<p>A <strong>substring</strong> is a contiguous (non-empty) sequence of characters within a string.</p>
<p>A <strong>vowel substring</strong> is a substring that <strong>only</strong> consists of vowels (<code>'a'</code>, <code>'e'</code>, <code>'i'</code>, <code>'o'</code>, and <code>'u'</code>) and has <strong>all five</strong> vowels present in it.</p>
<p>Given a string <code>word</code>, return <em>the number of <strong>vowel substrings</strong> in</em> <code>word</code>.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> word = “aeiouu”</p>
<p><strong>Output:</strong> 2</p>
<p><strong>Explanation:</strong> The vowel substrings of word are as follows (underlined):</p>
<ul>
<li>
<p>“<strong>aeiou</strong>u”</p>
</li>
<li>
<p>“<strong>aeiouu</strong>”</p>
</li>
</ul>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> word = “unicornarihan”</p>
<p><strong>Output:</strong> 0</p>
<p><strong>Explanation:</strong> Not all 5 vowels are present, so there are no vowel substrings.</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> word = “cuaieuouac”</p>
<p><strong>Output:</strong> 7</p>
<p><strong>Explanation:</strong> The vowel substrings of word are as follows (underlined):</p>
<ul>
<li>
<p>“c<strong>uaieuo</strong>uac”</p>
</li>
<li>
<p>“c<strong>uaieuou</strong>ac”</p>
</li>
<li>
<p>“c<strong>uaieuoua</strong>c”</p>
</li>
<li>
<p>“cu<strong>aieuo</strong>uac”</p>
</li>
<li>
<p>“cu<strong>aieuou</strong>ac”</p>
</li>
<li>
<p>“cu<strong>aieuoua</strong>c”</p>
</li>
<li>
<p>“cua<strong>ieuoua</strong>c”</p>
</li>
</ul>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= word.length <= 100</code></li>
<li><code>word</code> consists of lowercase English letters only.</li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
countVowelSubstrings
-