Cody

Problem 45356. Connect Four - 02

Solution 2137373

Submitted on 22 Feb 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
x = [2 2 1 1 2 1 2 1 1 2 0 1 1 1 1 2 1 2 2 1 1 2 2 2 2 1 1 2 2 1 1 2 1 1 2 1 2 1 2 2 2 1 0 2 2 2 2 1 1 1 1 1 2 1 2 1 1 2 1 1 1 1 2 1]; assert(isequal(connect_four_3(x),'invalid'))

2   Pass
x = [2 2 1 1 2 0 2 1 1 2 2 1 1 1 1 2 1 2 2 1 1 2 2 2 2 1 1 2 2 1 1 2 1 1 1 1 2 1 2 2 2 1 1 2 2 2 2 1 1 1 1 1 2 1 2 1 1 2 1 1 1 1 2 1]; assert(isequal(connect_four_3(x),'valid'))

3   Pass
x = [2 2 1 1 2 1 2 0 1 2 2 1 1 1 1 2 1 2 2 1 1 2 2 2 2 1 2 2 2 1 1 2 1 1 1 1 2 1 2 2 2 1 1 2 2 2 0 1 1 1 1 1 2 1 2 1 1 2 1 1 1 1 2 1]; assert(isequal(connect_four_3(x),'invalid'))

4   Pass
x = [0 0 0 0 0 0 0 0 1 2 0 0 1 1 1 0 1 2 2 0 1 2 2 0 2 1 2 0 2 1 1 2 1 1 1 1 2 1 2 2 2 1 2 2 2 2 2 1 1 1 1 1 2 1 2 1 1 2 1 1 1 1 2 1]; assert(isequal(connect_four_3(x),'valid'))

5   Pass
x = [1 0 0 0 0 0 0 0 1 2 0 0 1 1 1 0 1 2 2 0 1 2 2 0 2 1 2 0 2 1 1 0 1 1 1 1 2 1 2 0 2 1 2 2 2 2 2 0 1 1 1 1 2 1 2 0 0 2 1 1 1 1 2 0]; assert(isequal(connect_four_3(x),'invalid'))

6   Pass
x=zeros(8); assert(isequal(connect_four_3(x),'valid'))