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

2

u/[deleted] May 08 '15

Heh yeah, that is pretty much what I was describing I hope! I wasn't sure how to describe the behavior of alphabetizing where you "tie-break" with the next letter/digit

2

u/gee_buttersnaps May 08 '15

?If the second digit on the tie is bigger than the first digit of the other number, swap.

0

u/Tysonzero May 08 '15

Right but what if there is NO digit, should it come first or last?

First instinct gives me first:

{95, 9} gives 995

But then you get shit like:

{9596, 95} gives 959596 instead of 959695