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

28 lines
741 B
HTML
Raw Normal View History

2022-03-27 20:37:52 +08:00
<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>