Problem 45269. Game of life - 01
Refer to https://en.wikipedia.org/wiki/Conway's_Game_of_Life
given a set of cells (the initial state) represented by 1(live) and 0(dead) , u need to find - within the next 'n' stage - in which one, maximum number of cells were alive.
Some assumptions -
- the set can not expand. it'll maintain it's initial size. so generation of new cells outside the initial set is barred.
- the board can be wrapped around (toroidal).
for example -
- a=[1 0 0 0; 0 1 0 0; 0 0 1 0; 1 0 0 1]
- after 1 stage, it becomes
a1=[1 1 0 1; 0 1 0 0; 1 1 1 1; 1 1 0 1]
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers12
Suggested Problems
-
Project Euler: Problem 2, Sum of even Fibonacci
2299 Solvers
-
Relative ratio of "1" in binary number
1409 Solvers
-
88 Solvers
-
Given a square and a circle, please decide whether the square covers more area.
956 Solvers
-
Find two triangular numbers whose sum is input.
93 Solvers
More from this Author165
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!