问题描述:
According to the Wikipedia's article(问题详细介绍): "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970." Given aboard withm byn cells, each cell has an initial statelive (1) ordead (0). Each cell interacts with itseight neighbors(horizontal, vertical, diagonal(对角线的)) using the following four rules (taken from the above Wikipedia article):
Write a function to compute the next state (after one update) of the board given its current state.
Follow up:
1.Could you solve it in-place? Remember that the board needs to be updated at the same time: You cannot update some cells first and then use their update