Arrange the number 293 6492 get the smallest number
Answers
Answered by
0
Answer:
arrange = {5, 6, 2, 9, 21, 1}
Output: 1212569
Step-by-step explanation:
If all the given numbers are of at most one digit then simple approach is sorting all numbers in ascending order. But if there are sum number which have more than a single digit then this approach will not work.
Therefore, we have to sort the array by comparing any two elements in the following way:
If the elements are A and B, then compare (A + B) with (B + A) where + represents concatenation.
HOPE THIS HELPS YOU!!!
Similar questions