Cody

# Problem 58. Tic Tac Toe FTW

Solution 1964798

Submitted on 7 Oct 2019 by Hans Lindberg
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 0 1 0 -1 0 -1 -1 1]; b = [4 8]; out = ticTacToe(a); assert(isequal(out(:), b(:)))

Valids = 2 4 8 wins = 4 wins = 4 8 wins = 4 8 5 wins = 4 8 5 wins = 4 8

2   Pass
a = [ 1 0 0 0 -1 0 -1 0 1]; b = [0]; out = ticTacToe(a); assert(isequal(out(:), b(:)))

Valids = 2 4 6 7 8 wins = 1×0 empty double row vector wins = 1×0 empty double row vector wins = 5 wins = 5 wins = 1×0 empty double row vector

3   Pass
a = [ 1 0 0 0 1 -1 1 -1 -1]; b = [2 7]; out = ticTacToe(a); assert(isequal(out(:), b(:)))

Valids = 2 4 7 wins = 1×0 empty double row vector wins = 2 wins = 2 9 wins = 2 9 7 wins = 2 7

4   Pass
a = [ 1 0 0 -1 1 -1 1 -1 0]; b = [7 9]; out = ticTacToe(a); assert(isequal(out(:), b(:)))

Valids = 4 7 9 wins = 1×0 empty double row vector wins = 2 wins = 2 9 wins = 2 9 7 wins = 7 9