Verified interview challenge
Simulate Conway's Game of Life
Simulate a grid of living and dead cells without letting one update change the rest of the same step.
Unlock with Full AccessThe challenge
Read a binary grid and advance it through a fixed number of Conway's Game of Life steps. Every cell in a step must be calculated from the same previous state. Handle the edges of the finite grid and print the final result in the required console format.
What you'll practise
Synchronous updates
Keep the previous grid separate from changes being computed for the next step.
Boundary handling
Apply neighbour rules correctly at edges and corners while preserving the output format.
import sys
def main():
# Read input and print your result
passRun your code to see results.