Skip to main content
6 of 6
added 4 characters in body
aeh5040
  • 1.7k
  • 5
  • 20

Python 3, 135 127 123 bytes

Answering my own question since there is no python solution yet. Expects a transposed matrix. Strongly inspired by Lynn's rotation method. I'm sure there is room for improvement!

def f(x):
 x+=[[3]*len(x)]
 for _ in x*4*len(x):x=[map(lambda a,b:a|a*2&b,y,(0,*y))for y in zip(*x)][::-1]
 return 3in x[0]

Try it online!

aeh5040
  • 1.7k
  • 5
  • 20