1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-25 17:50:26 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/ 字母与数字 [find-longest-subarray-lcci].html

26 lines
744 B
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>给定一个放有字母和数字的数组,找到最长的子数组,且包含的字母和数字的个数相同。</p>
<p>返回该子数组,若存在多个最长子数组,返回左端点下标值最小的子数组。若不存在这样的数组,返回一个空数组。</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>["A","1","B","C","D","2","3","4","E","5","F","G","6","7","H","I","J","K","L","M"]
<strong>输出:</strong>["A","1","B","C","D","2","3","4","E","5","F","G","6","7"]
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>["A","A"]
<strong>输出:</strong>[]
</pre>
<p><strong>提示:</strong></p>
<ul>
<li><code>array.length &lt;= 100000</code></li>
</ul>