#K51187. Sorted Digits Extraction
Sorted Digits Extraction
Sorted Digits Extraction
You are given a list of feedback strings. Each feedback string may contain both letters and digits. Your task is to extract all the digits from each feedback string, sort them in ascending order, and then concatenate them to form a single string for each feedback. If a feedback string does not contain any digits, output an empty string for that line.
The input is provided via standard input (stdin) and the output should be printed to standard output (stdout). Each feedback result should be printed on a new line, in the same order as the input.
Note: Sorting is performed based on the digit characters (i.e. '0' to '9').
inputFormat
The first line of the input contains an integer T (1 ≤ T ≤ 100), representing the number of feedback strings. The following T lines each contain a non-empty feedback string consisting of alphanumeric characters.
outputFormat
Output T lines where each line contains a string formed by the sorted digits extracted from the corresponding feedback string. If no digits are found in a feedback string, output an empty line.
## sample3
great3experience4
love1it2
no9issues8
34
12
89
</p>