Problem 2225. Three...is a magic number.
Yes it is...
It's a magic number...
To help you get rid of that earworm, here's a new Cody problem. You are given a square matrix containing positive integers. We want to determine if there are three consecutive occurrences of the same number in a row or column. For example:
1 1 1 4 2 3 2 3 4
Should be marked "true" because there are three consecutive ones in the first row. Likewise
5 2 3 5 3 2 5 4 1
should also be marked "true" because there are three consecutive fives in the first column. However:
5 2 3 3 5 2 1 4 5
Is false, as we do not care about the three consecutive fives along the trace of the matrix. The matrix will always be at least 3x3, but they can be larger. Good luck!
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers87
Suggested Problems
-
Return the largest number that is adjacent to a zero
5342 Solvers
-
Sort a list of complex numbers based on far they are from the origin.
5635 Solvers
-
Find the peak 3n+1 sequence value
2498 Solvers
-
Get the area codes from a list of phone numbers
1053 Solvers
-
Flip the main diagonal of a matrix
806 Solvers
More from this Author80
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!