Cody

# Problem 45354. Connect Four - 01

Solution 2173807

Submitted on 25 Mar 2020 by Binbin Qi
• Size: 73
• This is the leading solution.
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 2 2 1 1 1 1; 1 2 1 1 2 2 2; 2 1 2 2 2 1 1; 1 1 2 1 2 1 1; 2 1 1 2 2 2 1]; assert(isequal(connect_four(x),1))

2   Pass
x =[ 2 2 1 1 2 1 2 1 2 2 1 1 1 1 1 2 1 1 2 2 2 2 1 2 2 2 1 1 1 1 2 1 2 1 1 2 1 1 2 2 2 2]; assert(isequal(connect_four(x),0))

3   Pass
x = [2 2 1 1 2 1 2 1 2 2 1 1 1 1 1 2 1 1 1 2 2 2 1 2 2 2 1 1 1 1 2 1 2 1 2 2 1 1 2 2 2 2 1 1 2 1 2 1 2]; assert(isequal(connect_four(x),1))

4   Pass
x =[2 2 1 1 2 1 2 1 1 2 2 1 1 1 1 2 1 2 1 1 1 2 2 2 2 1 2 2 2 1 1 2 1 1 2 1 2 1 2 2 2 1 1 2 2 2 2 1 1 1 2 1 2 1 2 1]; assert(isequal(connect_four(x),2))

5   Pass
x = [2 2 1 1 2 1 2 1 1 2 2 1 1 1 1 2 1 2 1 1 1 2 2 2 2 1 2 2 2 1 1 2 1 1 2 1 2 1 2 2 2 1 1 2 2 2 2 1 1 1 2 1 2 1 2 1 1 2 1 1 1 1 2 1]; assert(isequal(connect_four(x),0))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!