← 返回 uber 的题目列表Sort Clothing Sizes
类型:online_judge
Problem: Sort Clothing Sizes
You are given a string sizes, where each character represents a clothing size. The valid sizes are:
'S': Small
'M': Medium
'L': Large
Implement a function that sorts the sizes in ascending order:
S < M < L
Return the sorted string.
If the input contains unknown characters, ignore them.
Input Format
One line containing the string sizes.
The string may be empty.
Output Format
Print the sorted size string.
Constraints
0 <= len(sizes) <= 100000
sizes may contain S, M, L, and other unknown characters.
Example 1
Input:
MSLMS
Output:
SSMML
Example 2
Input:
LLSSMM
Output:
SSMMLL
Example 3
Input:
MXLZS
Output:
SML
Explanation: Unknown characters X and Z are ignored.
Example
Input
MSLMS
Output
SSMML