Lexicographically Maximum Substring

Given a string s consisting only of lowercase English letters, return its lexicographically largest non-empty contiguous substring.

Strings are compared using standard lexicographic order: comp...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: