Implement an algorithm to solve the Game of Life.
Given a rectangular 2D integer array board, update it to its next state in place. A live cell is 1, and a dead cell is 0. Each cell has up to eight neighbors. A live cell survives with two or three live neighbors, a dead cell becomes live with exactly three live neighbors, and all other cells become or remain dead. The function should return nothing; the input board must contain the next state after the function completes.
Function signature: def game_of_life(board):
Constraints: 0 <= rows, cols <= 100, and every row has the same length.
def game_of_life(board):