Day 3: Foggy Forest
Problem One
Given a grid of spaces that can either contain a plot of ground (marked with a dot ".") or a tree (marked with a hash "#"), find how many perfect squares are formed by four trees at all four corners of the square. The sides must all have equal the number of spaces between adjacent corners; for example:
# . . . #
. . . . .
. . . . .
. . . . .
# . . . #
The above is a square with four trees in the corners because there are three spaces between each tree in the corner and their adjacent tree in the next corner.