Great challenge

I'm not very proud of my `#grids` method but I don't see another solution. And you?