code as module method with specs

Interesting approach. FYI - every time `solution` is called, the method has to do significant work. Not very ideal.

I'd remove the `solution` method and move it's logic into a `let(:solution) do ... end` block which itself would live inside a `describe` block. I believe the result of calling `solution` would then be cached in an `@solution` instance variable.