mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 19:31:42 +08:00
add leetcode problem-cn part3
This commit is contained in:
23
算法题(国内版)/problem (Chinese)/划分字母区间 [partition-labels].html
Normal file
23
算法题(国内版)/problem (Chinese)/划分字母区间 [partition-labels].html
Normal file
@@ -0,0 +1,23 @@
|
||||
<p>字符串 <code>S</code> 由小写字母组成。我们要把这个字符串划分为尽可能多的片段,同一字母最多出现在一个片段中。返回一个表示每个字符串片段的长度的列表。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例:</strong></p>
|
||||
|
||||
<pre>
|
||||
<strong>输入:</strong>S = "ababcbacadefegdehijhklij"
|
||||
<strong>输出:</strong>[9,7,8]
|
||||
<strong>解释:</strong>
|
||||
划分结果为 "ababcbaca", "defegde", "hijhklij"。
|
||||
每个字母最多出现在一个片段中。
|
||||
像 "ababcbacadefegde", "hijhklij" 的划分是错误的,因为划分的片段数较少。
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>S</code>的长度在<code>[1, 500]</code>之间。</li>
|
||||
<li><code>S</code>只包含小写字母 <code>'a'</code> 到 <code>'z'</code> 。</li>
|
||||
</ul>
|
Reference in New Issue
Block a user