#C13660. Remove Duplicate Characters from String
Remove Duplicate Characters from String
Remove Duplicate Characters from String
You are given a string. Your task is to remove duplicate characters from the string, keeping only the first occurrence of each character. The order of characters should remain as in the original string. Treat uppercase and lowercase letters as distinct characters.
Example:
- Input: "Google" → Output: "Gogle"
- Input: "Development" → Output: "Devlopmnt"
In mathematical terms, if the input string is \( S = s_1 s_2 \ldots s_n \), you need to construct a string \( T \) such that each character \( s_i \) appears in \( T \) only if it has not appeared in \( s_1, s_2, \ldots, s_{i-1} \).
inputFormat
The input is provided via standard input (stdin) as a single line containing the string. The string may be empty and can contain any visible ASCII characters.
outputFormat
Output to standard output (stdout) the transformed string where duplicate characters have been removed, preserving the order of their first occurrence.## sample
Google
Gogle