Class Solution

  • All Implemented Interfaces:

    
    public final class Solution
    
                        

    1163 - Last Substring in Lexicographical Order.

    Hard

    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:

    • <code>1 <= s.length <= 4 * 10<sup>5</sup></code>

    • s contains only lowercase English letters.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Solution()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final String lastSubstring(String s)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait