You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, strings `"aeiou"` and `"aaaaaaeiiiioou"` are considered *beautiful*, but `"uaeio"`, `"aeoiu"`, and `"aaaeeeooo"` are *not beautiful*.
15
+
*子字符串* 是字符串中一个连续的字符序列。
14
16
15
-
Given a string `word` consisting of English vowels, return _the *length of the longest beautiful substring* of _`word`_. If no such substring exists, return _`0`.
17
+
*示例 1:*
16
18
17
-
A *substring* is a contiguous sequence of characters in a string.
19
+
....
20
+
输入:word = "aeiaaioaaaaeiiiiouuuooaauuaeiu"
21
+
输出:13
22
+
解释:最长子字符串是 "aaaaeiiiiouuu" ,长度为 13 。
23
+
....
18
24
19
-
20
-
*Example 1:*
25
+
*示例 2:*
21
26
22
-
[subs="verbatim,quotes"]
23
-
----
24
-
*Input:* word = "aeiaaio[.underline]#aaaaeiiiiouuu#ooaauuaeiu"
25
-
*Output:* 13
26
-
*Explanation:* The longest beautiful substring in word is "aaaaeiiiiouuu" of length 13.
27
-
----
27
+
....
28
+
输入:word = "aeeeiiiioooauuuaeiou"
29
+
输出:5
30
+
解释:最长子字符串是 "aeiou" ,长度为 5 。
31
+
....
28
32
29
-
*Example 2:*
33
+
*示例 3:*
30
34
31
-
[subs="verbatim,quotes"]
32
-
----
33
-
*Input:* word = "aeeeiiiioooauuu[.underline]#aeiou#"
34
-
*Output:* 5
35
-
*Explanation:* The longest beautiful substring in word is "aeiou" of length 5.
35
+
....
36
+
输入:word = "a"
37
+
输出:0
38
+
解释:没有美丽子字符串,所以返回 0 。
39
+
....
36
40
37
-
----
41
+
*提示:*
38
42
39
-
*Example 3:*
43
+
* `1 \<= word.length \<= 5 * 10^5^`
44
+
* `word` 只包含字符 `a`,`e`,`i`,`o` 和 `u` 。
40
45
41
-
[subs="verbatim,quotes"]
42
-
----
43
-
*Input:* word = "a"
44
-
*Output:* 0
45
-
*Explanation:* There is no beautiful substring, so return 0.
46
-
47
-
----
48
-
49
-
50
-
*Constraints:*
51
-
52
-
53
-
* `1 <= word.length <= 5 * 10^5^`
54
-
* `word` consists of characters `'a'`, `'e'`, `'i'`, `'o'`, and `'u'`.
0 commit comments