1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/按字典序排在最后的子串 [last-substring-in-lexicographical-order].html
2022-03-29 12:43:11 +08:00

28 lines
741 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>给你一个字符串&nbsp;<code>s</code>&nbsp;,找出它的所有子串并按字典序排列,返回排在最后的那个子串。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>s = "abab"
<strong>输出:</strong>"bab"
<strong>解释:</strong>我们可以找出 7 个子串 ["a", "ab", "aba", "abab", "b", "ba", "bab"]。按字典序排在最后的子串是 "bab"。
</pre>
<p><strong>示例&nbsp;2</strong></p>
<pre>
<strong>输入:</strong>s = "leetcode"
<strong>输出:</strong>"tcode"
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= s.length &lt;= 4 * 10<sup>5</sup></code></li>
<li><code>s</code> 仅含有小写英文字符。</li>
</ul>