Helpful Maths
Practice this coding question on Coding Gurukul.
Problem statement
An addition expression contains only the single-digit values 1, 2 and 3, separated by plus signs. Rearrange its terms into nondecreasing order without changing any term or adding spaces. Output the reordered expression.
Input format
One line containing the expression.
Output format
Print the sorted expression using + separators.
Constraints
1 <= expression length <= 100; expression is valid.
Sample input
3+1+2+1
Sample output
1+1+2+3
Sign in to run or submit a solution in C++, Java or Python.