Any thoughts?
I made a little progress: In diff(M,1,2), undesirable rows will always have -1 then 1 (reading from left to right), with any number of zeros in between. But the problem then becomes to issolate this pattern, as the number of zeros varies, and there are any number of leading and trailing numbers. If you could ignore the zeros in between then in the next iteration of diff() undesirable rows would exclusively contain a 2.
But how do you ignore the zeros in between? And how do you isolate this pattern from the leading and trailing numbers?