here's efficient oneliner without any string manipulation

divide every number by 10^(log10(x).ceil)
sort
convert back to original numbers
join array into string

there are edge-cases where this doesn't work but they can be dealt with 
easily - have to go back to work :)

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to