r/programming • • 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

2.1k comments sorted by

View all comments

Show parent comments

1

u/bnelson May 08 '15

".join(sorted([str(x) for x in [50, 2, 1, 6, 56, 90, 900, 999]], reverse=True))

(It doesn't work for all inputs, just most, but it was my first smart-ass response)

1

u/psymunn May 08 '15

Does that not sort correct?
1 should sort less than everything else, and 999 should sort more than everything else. 90900 is a larger number than 90090. which digit do you think gets missorted?