#C5420. Remove Duplicate Characters

    ID: 49068 Type: Default 1000ms 256MiB

Remove Duplicate Characters

Remove Duplicate Characters

In this problem, you are given a string and your task is to remove all duplicate characters while preserving the order of their first occurrence. More formally, given a string (s), construct a new string by removing all characters that appear more than once beyond their first appearance. For example, given the input string "programming", the output should be "progamin". This problem tests your understanding of string manipulation and use of data structures to track seen characters.

inputFormat

The input consists of a single line containing the string (s), which may include lowercase letters. The string can be empty.

outputFormat

Output a single line containing the string after all duplicate characters have been removed, preserving the order of their first occurrence.## sample

programming
progamin