Back to problems

Game of Life — In-Place and Infinite Board

Algorithm · Citadel · Hard

Requirements Given an m x n board for Conway's Game of Life, where 1 denotes a living cell and 0 denotes a dead cell, advance the board by one generation. Every cell must be updated simultaneously according to the standard Conway rules. Use the following call shape: Examples Example 1 Input: Output: The vertical three-cell line becomes horizontal after one generation. Example 2 Input: Output: Each cell has enough live neighbors to remain alive, so this block does not change.…

Checking your access…