Second problem I have trouble with the second part.
For the first part, I solved it by creating a map of the area and going through each square to compute it’s next value.
This simple approach works well for the first part of the problem, but does not scale well to a larger number of iterations like the second part of the problem requires. I will have to come back to this one also when I have a little more time.
UPDATE: I have solved the second part for this on December 20th by keeping a list of all the maps calculated so far and checking when a loop occurs. This reduces the computation time to around half a second as there is only about 550 iterations to do.