Skip to main content
added 4 characters in body
Source Link
aeh5040
  • 1.7k
  • 5
  • 20

Python 3, 135 127 127123 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 for y in 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!Try it online!

Python 3, 135 127 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 for y in 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!

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!

deleted 7 characters in body
Source Link
aeh5040
  • 1.7k
  • 5
  • 20

Python 3, 135135 127 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[0]=[y*3forx+=[[3 for y in x[0]]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 max(x[-1])>13in x[0]

Try it online!Try it online!

Python 3, 135 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[0]=[y*3for y in x[0]]
 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 max(x[-1])>1

Try it online!

Python 3, 135 127 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 for y in 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!

added 2 characters in body
Source Link
aeh5040
  • 1.7k
  • 5
  • 20

Python 3, 135 bytes

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

def f(x):
 x[0]=[y*3for y in x[0]]
 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 max(x[-1])>1

Try it online!

Python 3, 135 bytes

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

def f(x):
 x[0]=[y*3for y in x[0]]
 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 max(x[-1])>1

Try it online!

Python 3, 135 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[0]=[y*3for y in x[0]]
 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 max(x[-1])>1

Try it online!

added 68 characters in body
Source Link
aeh5040
  • 1.7k
  • 5
  • 20
Loading
added 153 characters in body
Source Link
aeh5040
  • 1.7k
  • 5
  • 20
Loading
Source Link
aeh5040
  • 1.7k
  • 5
  • 20
Loading