Only write to array when needed
Only write to array when needed

Only write into the array for the grid when the new value is not the same as the existing value.

martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode,martincostello/adventofcode