The other day at work I was making this algorithm, but did not get it to work. It looked so simple, but it was not – so I worked with it for a few hours without result.
When I took the time of for a few days, and decided to look at the problem again I fixed it in a few minutes. It was not a perfect fix, but as good as.
So, the tip when you are stuck:
Take some days off, and think of other things, and when you are back you may se an easy solution.