#K69507. Separate and Sort Characters and Digits
Separate and Sort Characters and Digits
Separate and Sort Characters and Digits
You are given an alphanumeric string which contains letters and digits. Your task is to separate the letters and digits, sort the letters in alphabetical order and the digits in ascending numerical order, and then concatenate them with the sorted letters coming first followed by the sorted digits.
For example, if the input is a2b1c3
, then the output should be abc123
.
This problem tests your ability to process strings, use sorting, and manage input/output operations in standard input/output format.
inputFormat
A single line string consisting of letters and digits is provided via standard input.
outputFormat
Output the combined string after sorting letters and digits separately. The letters sorted alphabetically come first followed by the digits sorted in ascending order.## sample
a2b1c3
abc123