r/programming • u/svpino • May 08 '15
Five programming problems every Software Engineer should be able to solve in less than 1 hour
https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour
2.5k
Upvotes
3
u/MSgtGunny May 08 '15 edited May 08 '15
I would sort based on first digit of each number, if there is a conflict, it checks the next digit of both or next digit of one and the current digit if there are no more digits for the number.
Ie 5 53 55 59 501 would be sorted as 59, 55, 5, 53, 501
Maybe a modified radix sort would do the job.