#K71182. Remove Duplicate Characters
Remove Duplicate Characters
Remove Duplicate Characters
Given a string s, remove all duplicate characters so that each character appears only once. The order of characters in the output should correspond to their first appearance in the input.
For example:
- If
s = "banana"
, the output should beban
. - If
s = "apple"
, the output should beaple
. - If
s = "racecar"
, the output should berace
.
Solve the problem using standard input and output.
inputFormat
The input is provided as a single line from standard input containing the string s.
outputFormat
Output the resulting string after removing duplicate characters, preserving the original order of their first occurrences. The result should be printed to standard output.## sample
banana
ban