Skip to content

Files

Latest commit

 

History

History
52 lines (31 loc) · 1.16 KB

File metadata and controls

52 lines (31 loc) · 1.16 KB

Description

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

 

Example 1:

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

Example 2:

Input: "leetcode"
Output: "tcode"

 

Note:

  1. 1 <= s.length <= 4 * 10^5
  2. s contains only lowercase English letters.

Solutions

Python3

Java

...