Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Moore Neighbourhood by _Chico_
def count_neighbours(grid, row, col):
return sum(sum(((0,) + l)[col:col + 3]) for l in (((0,),) + grid)[row:row + 3]) - grid[row][col]
July 9, 2021