Removing duplicate characters while preserving order
Kotlin
Medium
strings
Task «Removing duplicate characters while preserving order»
Write a program that takes a string containing only lowercase Latin letters and removes all duplicate characters from it, while preserving the order of the first occurrence of each character. The program should output the resulting string without duplicates. The length of the string does not exceed 10^5.
Input Format
One line consisting of lowercase Latin letters (a-z). The length of the string is from 1 to 100000.
Output Format
One line — the original string without duplicate characters, the order of the first occurrence is preserved.
Examples
Example 1
INPUT
hello
OUTPUT
helo
Example 2
INPUT
aabbcc
OUTPUT
abc
main.kt