Skip to content

Latest commit

 

History

History
55 lines (34 loc) · 1.19 KB

File metadata and controls

55 lines (34 loc) · 1.19 KB

中文文档

Description

Given a string s, return the last substring of s in lexicographical order.

 

Example 1:

Input: s = "abab"
Output: "bab"
Explanation: The substrings are ["a", "ab", "aba", "abab", "b", "ba", "bab"]. The lexicographically maximum substring is "bab".

Example 2:

Input: s = "leetcode"
Output: "tcode"

 

Constraints:

  • 1 <= s.length <= 4 * 105
  • s contains only lowercase English letters.

Solutions

Python3

Java

...