#K41362. Remove Duplicates and Sort
Remove Duplicates and Sort
Remove Duplicates and Sort
Given a string ( S ), your task is to remove all duplicate characters so that each character appears only once, and then output the resulting string in lexicographical (alphabetical) order.
For example, for ( S = "bcabc" ), the unique characters are ( {a, b, c} ), and sorted order produces ( "abc" ).
inputFormat
The input consists of a single line containing the string ( S ). The string ( S ) may contain alphabets or other printable characters.
outputFormat
Output the string containing unique characters in lexicographical order.## sample
bcabc
abc