I could probably optimize that by getting the iterators for all 4
directions and then to the scan on each of them in a loop, but I'm with
with this right now.
Took multiple seconds to run, so I wonder if there's a more efficient
way to do this. Maybe would be better to have a Vec<Vec<usize>> instead
of putting all lines after each other.