okay, this is not exactly a #toyprogrammingchallenge but I hope you hate this problem as much as I did...
The problem is not just getting the right solution, but getting it in under the running timeout of 12000 ms. Good luck.
@freemo They don't tell you that you have to do it in any particular time or space. It is a bad challenge form that part. When you start there are a few tests that you run. Then when you think you are happy and submit it, it runs against more tests. Some of them are over a million long with the numbers being at the beginning and end, and also in the middle. I did put a link in for the actual problem. It has a ui and a working compiling and testing environment. I had the logic solved dead on, but couldn't be certain until I got it efficient enough to go through the big blind tests without timing out. You get very little feedback on a timeout :)
@Absinthe hmm interesting
@Absinthe Yea not knowing how to optimize in this case is just not enough info IMO
@freemo would it help to know that the solution is based on memoization ?
@Absinthe Oh I already speculated a solution (and a few other tweaks). Just too bust to try it out. In the middle of writing a specification and trying to learn bikeshed at the same time
@freemo I said a million, but I meant 10 million.