Cody

# Problem 58. Tic Tac Toe FTW

Solution 2184343

Submitted on 31 Mar 2020 by Simon Hönes
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(:)))

leftTopToRightBottom = 1 -1 1 leftBottomToRightTop = -1 -1 1 possibleAbsolutIndices = 4 possibleAbsolutIndices = 4 8 wins = 4 8

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

leftTopToRightBottom = 1 -1 1 leftBottomToRightTop = -1 -1 0 wins = 0

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

leftTopToRightBottom = 1 1 -1 leftBottomToRightTop = 1 1 0 possibleAbsolutIndices = 2 index = 3 possibleAbsolutIndices = 2 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(:)))

leftTopToRightBottom = 1 1 0 leftBottomToRightTop = 1 1 0 index = 3 possibleAbsolutIndices = 9 index = 3 possibleAbsolutIndices = 9 7 wins = 7 9