#C5250. Unique Sorted String Generator
Unique Sorted String Generator
Unique Sorted String Generator
You are given a string s
and your task is to remove all duplicate characters from s
and then output the unique characters in lexicographical order. This problem requires you to process multiple test cases. For each test case, you will be given one string, and you must print the result on a new line.
For example, if the input string is hello
, after processing, the output should be ehlo
because these are the unique characters sorted in lexicographical order.
Note: All input should be read from standard input and all output should be written to standard output.
inputFormat
The first line of input contains a single integer T
representing the number of test cases.
Each of the following T
lines contains a non-empty string s
.
outputFormat
For each test case, output a single line containing the unique characters of the string s
, sorted in lexicographical order.
1
hello
ehlo
</p>