Revise question 17

I added the naive and improved solutions.

As for the tests, I would put them in a separate directory. Not everyone will care about them. And putting them in the same file may give a first impression that the solution is long and complex, and provoke a TLDR reaction.