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/DarkMacek May 08 '15

You could just sort them (as strings rather than ints)

3

u/wgunther May 08 '15

The lexicographic ordering won't work, which was my point. 92 is smaller than both 9295 and 9265 in lex order, but should come after 9265 and before 9295 in this ordering.

2

u/Tysonzero May 08 '15

Nope:

{95, 9}

Would return:

959

When you want:

995

0

u/timeshifter_ May 08 '15

Aaaand you failed the interview. Thanks for stopping in.