You need to reorder an expression like "3+2+1" to "1+2+3" (sorted in ascending order). Here's the approach:
Parse the input to extract the individual digits, ignoring the '+' signs.
Sort these digits in ascending order.
Print them joined by '+' signs. Since the digits are only 1, 2, or 3, you can use a simpler method: count how many of each digit appears. Then print all the 1s, then all the 2s, then all the 3s, with '+' between consecutive digits. This avoids explicit sorting.