This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
a = [ 1 0 0
0 -1 0
-1 0 1];
b = [0];
out = ticTacToe(a);
assert(isequal(out(:), b(:)))
idx =
3×3 logical array
0 1 1
1 0 1
0 1 0
b =
[]
at =
1 0 0
1 -1 0
-1 0 1
wins =
0
at =
1 1 0
0 -1 0
-1 0 1
wins =
0
at =
1 0 0
0 -1 0
-1 1 1
wins =
0
at =
1 0 1
0 -1 0
-1 0 1
wins =
0
at =
1 0 0
0 -1 1
-1 0 1
wins =
0
|
2 | Pass |
a = [ 1 0 0
0 1 -1
1 -1 -1];
b = [2 7];
out = ticTacToe(a);
assert(isequal(out(:), b(:)))
idx =
3×3 logical array
0 1 1
1 0 0
0 0 0
b =
[]
at =
1 0 0
1 1 -1
1 -1 -1
b =
2
wins =
2
at =
1 1 0
0 1 -1
1 -1 -1
wins =
2
at =
1 0 1
0 1 -1
1 -1 -1
b =
2 7
wins =
2 7
|
3 | Pass |
a = [ 1 0 0
-1 1 -1
1 -1 0];
b = [7 9];
out = ticTacToe(a);
assert(isequal(out(:), b(:)))
idx =
3×3 logical array
0 1 1
0 0 0
0 0 1
b =
[]
at =
1 1 0
-1 1 -1
1 -1 0
wins =
0
at =
1 0 1
-1 1 -1
1 -1 0
b =
7
wins =
7
at =
1 0 0
-1 1 -1
1 -1 1
b =
7 9
wins =
7 9
|
Compute a dot product of two vectors x and y
750 Solvers
559 Solvers
Try 1.5.4: Celsius to Fahrenheit
609 Solvers
The sum of the numbers in the vector
426 Solvers
5116 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!