Here's the trick: you can iterate through the string character by character. When you encounter a digit ('1', '2', or '3'), store it. When you encounter a '+', skip it. After collecting all digits, sort them and print with plus signs between.
Since the input only contains three possible numbers, you can count how many times each appears. Then output that many 1s, followed by that many 2s, followed by that many 3s.
Counting is easier than sorting. This counting approach is called counting sort, and it works when the range of values is small. You're trading a general sort algorithm for a specialized solution that's both simpler and faster.