+ 25
How can we sort an integer digits by its digits value
for example we input 58218 how can we rearrange its digits to output 88521 or we input 1324 and it output 4321? (in c++)
6 Answers
+ 21
š®š· M N perfect , Thank youš
+ 19
Hatsy Rei
Awesome š
+ 10
š®š· M N Thanks for the code!
+ 4
Hail the STL babyyy. It sorts in ascending order, so all you have to modify is to do std::reverse or write a sort implementation struct for std::sort.
https://code.sololearn.com/c7p6nes53u2Y/?ref=app
+ 3
its having many sorting algorithms that can be used to sorting the values