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

I agree, I would not have thought of all cases... I guess I am not a real software developer.

What do you think of this solution:

problem4 :: [Int] -> Int
problem4 l = let  cmp a b = compare (a ++ b) (b ++ a)
             in   read (concat (reverse (sortBy cmp (map show l))))