1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-12 02:41:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
Files
leetcode-problemset/leetcode-cn/problem (Chinese)/招式拆解 I [zui-chang-bu-han-zhong-fu-zi-fu-de-zi-zi-fu-chuan-lcof].html
2025-01-09 20:29:41 +08:00

44 lines
1.6 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>某套连招动作记作序列 <code>arr</code>,其中 <code>arr[i]</code> 为第 <code>i</code> 个招式的名字。请返回 <code>arr</code> 中最多可以出连续不重复的多少个招式。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>arr = "dbascDdad"
<strong>输出:</strong>6
<strong>解释:</strong>因为连续且最长的招式序列是 "dbascD" 或 "bascDd",所以其长度为 6。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>arr = "KKK"
<strong>输出:</strong>1
<strong>解释:</strong>因为无重复字符的最长子串是 <code>"K"</code>,所以其长度为 1。
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>arr = "pwwkew"
<strong>输出:</strong>3
<strong>解释:</strong>因为连续且最长的招式序列是 "wke",所以其长度为 3。&nbsp;
请注意区分 <strong>子串</strong><strong>子序列</strong> 的概念:你的答案必须是 <strong>连续招式</strong> 的长度,也就是 <strong>子串</strong>。而 "pwke" 是一个非连续的 <strong>子序列</strong>,不是 <strong>子串</strong>
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= arr.length &lt;= 40000</code></li>
<li><code>arr</code> 由英文字母、数字、符号和空格组成。</li>
</ul>
<p>&nbsp;</p>
<p>注意:本题与主站 3 题相同:<a href="https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/">https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/</a></p>
<p>&nbsp;</p>