Lexicographically Largest Identifier

Given a string key of length n consisting of lowercase English letters, build an identifier. Initially the interval is [l, r] with l = 1 and r = n (1-based indexing), and identifier is e...

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: