#K83557. Remove Duplicate Characters

    ID: 36223 Type: Default 1000ms 256MiB

Remove Duplicate Characters

Remove Duplicate Characters

Given a string consisting only of lowercase English letters, remove all duplicate characters while preserving the order of their first occurrence. For example, if the input is abracadabra, the output should be abrcd.

The solution involves iterating through the string, tracking seen characters, and building a new string that retains only the first occurrence of each character.

Note: All mathematical formulas, if any, are formatted in LaTeX. In this problem, no formulas are needed.

inputFormat

The input consists of a single line containing a string s that comprises lowercase English letters only.

Example: abracadabra

outputFormat

Output the resulting string after removing all duplicate characters while preserving their first occurrence.

Example: abrcd

## sample
abcdef
abcdef