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)/最长的字母序连续子字符串的长度 [length-of-the-longest-alphabetical-continuous-substring].html
2022-09-19 22:42:50 +08:00

34 lines
1.2 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> 是由字母表中连续字母组成的字符串。换句话说,字符串 <code>"abcdefghijklmnopqrstuvwxyz"</code> 的任意子字符串都是 <strong>字母序连续字符串</strong></p>
<ul>
<li>例如,<code>"abc"</code> 是一个字母序连续字符串,而 <code>"acb"</code><code>"za"</code> 不是。</li>
</ul>
<p>给你一个仅由小写英文字母组成的字符串 <code>s</code> ,返回其 <strong>最长</strong> 的 字母序连续子字符串 的长度。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>s = "abacaba"
<strong>输出:</strong>2
<strong>解释:</strong>共有 4 个不同的字母序连续子字符串 "a"、"b"、"c" 和 "ab" 。
"ab" 是最长的字母序连续子字符串。
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>s = "abcde"
<strong>输出:</strong>5
<strong>解释:</strong>"abcde" 是最长的字母序连续子字符串。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= s.length &lt;= 10<sup>5</sup></code></li>
<li><code>s</code> 由小写英文字母组成</li>
</ul>