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

10

u/erewok May 08 '15

Same here. I looked at the last one and wondered if I really could code a solution in an hour. "Maybe it's not like the others and there's a trick to it?" I wondered.

1

u/Tysonzero May 08 '15

Well there is sort of a trick to it: use brute force + eval. It sounds slow but it would actually take less than a millisecond to brute force because there are only 3**8 permutations.