#K9591. Smallest Permutation
Smallest Permutation
Smallest Permutation
Given a string s, return the lexicographically smallest permutation of the string. In other words, you are required to sort the characters of the string in increasing order.
The lexicographical order is defined as follows: for any two characters \(a\) and \(b\), \(a < b\) if the ASCII value of \(a\) is less than that of \(b\). Thus, sorting the string results in the smallest permutation.
For example, if the input string is "cba"
, the output should be "abc"
.
inputFormat
The input consists of a single line containing a non-empty string s
composed of English letters only. The string is provided via standard input (stdin).
Note: The string may contain duplicate characters.
outputFormat
Output the lexicographically smallest permutation of the string, i.e. the sorted string, via standard output (stdout).
## samplecba
abc