The plus signs are just presentation. The real data is the digits. Once you extract them into a vector, sorting becomes trivial.
You loop through a string and pick out what you need, ignoring the rest. This pattern appears in parsing, validation, and data cleaning problems.
You learned that Apply these lessons to future problems. The specific technique matters less than the approach: understand the problem, find the pattern, implement carefully. Practice similar problems to reinforce these skills.
Each solved problem builds your intuition for the next one.