Modify the String

Problem Overview

  • Given a string input_str of length n, repeatedly delete one occurrence of any duplicate character until all characters are distinct, then return the lexicographically maximum string.
  • Input: string input_str; Output: a string with unique characters that is lexicographically maximal.
  • Domain: string processing and text normalization, focusing on deduplication with ordering.
  • Often used in coding interview prep, this interview question is a string manipulation problem.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: