1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/统计字符串中的元音子字符串 [count-vowel-substrings-of-a-string].html
2022-03-29 12:43:11 +08:00

57 lines
1.9 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p><strong>子字符串</strong> 是字符串中的一个连续(非空)的字符序列。</p>
<p><strong>元音子字符串</strong><strong></strong> 由元音(<code>'a'</code><code>'e'</code><code>'i'</code><code>'o'</code><code>'u'</code>)组成的一个子字符串,且必须包含 <strong>全部五种</strong> 元音。</p>
<p>给你一个字符串 <code>word</code> ,统计并返回 <code>word</code><strong>元音子字符串的数目</strong></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>word = "aeiouu"
<strong>输出:</strong>2
<strong>解释:</strong>下面列出 word 中的元音子字符串(斜体加粗部分):
- "<em><strong>aeiou</strong></em>u"
- "<strong><em>aeiouu</em></strong>"
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>word = "unicornarihan"
<strong>输出:</strong>0
<strong>解释:</strong>word 中不含 5 种元音,所以也不会存在元音子字符串。
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>word = "cuaieuouac"
<strong>输出:</strong>7
<strong>解释:</strong>下面列出 word 中的元音子字符串(斜体加粗部分):
- "c<em><strong>uaieuo</strong></em>uac"
- "c<em><strong>uaieuou</strong></em>ac"
- "c<em><strong>uaieuoua</strong></em>c"
- "cu<em><strong>aieuo</strong></em>uac"
- "cu<em><strong>aieuou</strong></em>ac"
- "cu<em><strong>aieuoua</strong></em>c"
- "cua<em><strong>ieuoua</strong></em>c"</pre>
<p><strong>示例 4</strong></p>
<pre>
<strong>输入:</strong>word = "bbaeixoubb"
<strong>输出:</strong>0
<strong>解释:</strong>所有包含全部五种元音的子字符串都含有辅音,所以不存在元音子字符串。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= word.length &lt;= 100</code></li>
<li><code>word</code> 仅由小写英文字母组成</li>
</ul>