Keep First Occurrences
Keep only the first occurrence of every character, preserving order, and print the result.
Input: one line with the string S.
Output: S with later duplicates removed.
Constraints:
- 1 ≤ |S| ≤ 104
- S contains lowercase English letters
Sample Tests
Input 1
banana
Output 1
ban
Input 2
abc
Output 2
abc
Discussion (opens after you solve — no spoilers before)
No comments yet.