76. Remove Duplicate Characters
Core1000 ms256 MBSolved by 0%
Read one line and print it with every repeated character removed, keeping only the first occurrence of each and preserving the original order.
The comparison is case-sensitive, and spaces count as characters.
So programming becomes progamin.
Constraints - The line has between 1 and 100000 characters. - Printable ASCII only.
Input
A single line of text.
Output
Print the line with every repeated character removed, keeping the FIRST occurrence of each.
Inputprogramming
Outputprogamin
Noteis the worked example from the statement
Inputaabbcc
Outputabc
Notehas each character repeated exactly twice
Hint 1Approach
Hint 2Approach
Hint 3Pseudocode
Hint 4Full solution