Cody

# Problem 45269. Game of life - 01

Solution 2097552

Submitted on 18 Jan 2020 by Asif Newaz
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
n=1; A =[1 0 0 0;0 1 0 0;0 0 1 0;1 0 0 1]; y_correct = 1; assert(isequal(gameOfLife_3(A,n),y_correct))

B = 1 1 0 0 1 1 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 1 0 0 1 1 0 1 0 0 0 1 x = 1 1 0 1 0 1 0 0 1 1 1 1 1 1 0 1 y = 11

2   Pass
n=10; A =[1 0 0 0;0 1 0 0;0 0 1 0;1 0 0 1]; y_correct = 1; assert(isequal(gameOfLife_3(A,n),y_correct))

B = 1 1 0 0 1 1 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 1 0 0 1 1 0 1 0 0 0 1 x = 1 1 0 1 0 1 0 0 1 1 1 1 1 1 0 1 y = 11 B = 1 1 1 0 1 1 1 1 1 0 1 1 0 0 1 0 0 0 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 x = 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 y = 11 1 B = 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 x = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = 11 1 0 B = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = 11 1 0 0 B = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 x = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 y = 11 1 0 0 0 B = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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