r/programming • u/svpino • 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
10
u/B8foPIlIlllvvvvvv May 08 '15
Hmm. I consider solving different from writing out the code. If you can explain in detail how the solution for the fifth works, and how you'd go about coding it, seems fine to me.
A "simple" way to implement it is probably recursively. You'd pass something like 4 values - "sum so far", "previously formed number", "next number to use", "max number to use", and it returns a list of strings. Something like that.