This problem needs more test cases with the three of a kind appearing before the pair, such as:
1 0 1 0 0 0 0 0 0 0 1 0 1
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!