Leetcode 1163. Last Substring in Lexicographical Order
Return the lexicographically largest substring of s, i.e., the maximum among all suffixes and substrings starting at any index. Because n can be large (≤4·10^5), the challenge is to pick the maximal starting position efficiently (linear-time suffix comparison / Booth-style two-pointer approach) rather than enumerating all substrings.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.