Count the number of occurrences of "OXO" in rows, columns, diagonals and anti-diagonals.
Example:
>> board = ['OOX'
'XXO'
'OXO'];
>> count_OXO(board)
ans =
3
>> board = [' O '
'XXO'
'OXO'];
>> count_OXO(board)
ans =
1
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers19
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
3069 Solvers
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
2059 Solvers
-
How long is the longest prime diagonal?
412 Solvers
-
Generate N equally spaced intervals between -L and L
954 Solvers
-
Sum of odd numbers in a matrix
622 Solvers
More from this Author40
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!