Cody

Solution 2182492

Submitted on 30 Mar 2020 by Nathan Rhodes
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
A = [ ... 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0]; B = [ ... 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0]; assert(isequal(gameOfLife(A),B))

ANEW = 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 b = 2 b = 2 2 b = 2 2 2 b = 2 2 2 1 b = 2 2 2 1 5 0 0 0 b = 2 2 2 1 5 4 0 0 b = 2 2 2 1 5 4 3 0 b = 2 2 2 1 5 4 3 2 b = 2 2 2 1 5 4 3 2 2 0 0 0 b = 2 2 2 1 5 4 3 2 2 2 0 0 b = 2 2 2 1 5 4 3 2 2 2 2 0 b = 2 2 2 1 5 4 3 2 2 2 2 1 b = 2 2 2 1 5 4 3 2 2 2 2 1 4 0 0 0 b = 2 2 2 1 5 4 3 2 2 2 2 1 4 4 0 0 b = 2 2 2 1 5 4 3 2 2 2 2 1 4 4 2 0 b = 2 2 2 1 5 4 3 2 2 2 2 1 4 4 2 2 B = 4×4 logical array 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0

2   Pass
A = [ ... 0 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0]; B = [ ... 1 0 1 1 1 0 0 0 0 0 1 1 0 1 1 0]; assert(isequal(gameOfLife(A),B))

ANEW = 0 1 1 0 0 1 1 0 0 1 1 0 1 1 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