This solution takes advantage of the limited test cases where the maximum length of repeated segments is <= 2.
This solution is actually incorrect (but passes the test suite).
Set some matrix elements to zero
293 Solvers
Determine if input is a perfect number
147 Solvers
123 Solvers
convert matrix to single column
313 Solvers
432 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!