Remove Duplicate Characters
Easyjavapythonccppjavascript
Given a string, remove repeated characters, keeping only the first occurrence of each character in its original position.
Input Format
A single line containing the string S with no spaces.
Output Format
Print the string after removing duplicate characters.
Example 1
Input
programming
Output
progamin
Explanation: Each character is kept only at its first occurrence.
- 1 <= length of S <= 100000
- S consists of lowercase English letters.