LeetCode Solution, Medium, 289. Game of Life