Compute next generation of a 5x5 grid.
Read 5 lines of 5 chars each ('.' dead, 'O' alive). Print the next Conway's Game of Life generation (5 lines).
Standard rules: live cell with 2 or 3 live neighbors survives; dead cell with exactly 3 neighbors becomes alive.
Test input (a blinker):
.....
.....
.OOO.
.....
.....
Expected output:
.....
..O..
..O..
..O..
.....Sign in to save your code and track progress across devices.