Skip to main content
5 of 5
deleted 59 characters in body
Kirill L.
  • 14.1k
  • 2
  • 16
  • 50

R, 73 64 bytes

function(m,d=diff(rbind(m,0)),`-`=rowSums)any(d[-d>0,]+d[-d<0,])

Try it online!

Based on the idea in Leo's Husk answer.

Takes input as a matrix m of 1s and 0s with each pattern corresponding to a row. Outputs a swapped T/F value (in the footer, the results are swapped back).

Kirill L.
  • 14.1k
  • 2
  • 16
  • 50