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 * 105s contains only lowercase English letters.Solutions for this problem are being prepared.
Try solving it yourselfLongest Substring Without Repeating Characters - Leetcode 3 - Python • NeetCode • 657,697 views views
Watch 9 more video solutions →Practice Last Substring in Lexicographical Order with our built-in code editor and test cases.
Practice on FleetCodePractice this problem
Open in Editor