Part 2 doesn't actually require tracking state at all, it's enough to
just follow the rules and count every DFS that lands on a target square.
Part 1 optimized by only tracking which targets have been previously
visited, instead of all squares.
Both parts, pass position reference to recursive calls instead of by
value for tiny improvement.