Skip to main content
Bounty Ended with 50 reputation awarded by user41805
explanation
Source Link
ngn
  • 15.3k
  • 2
  • 43
  • 87

APL (Dyalog Unicode), 44 bytes

thanks @Adám for the ⍸⍣¯1 trick

(⊂a)∊(⍉¨⊢,⌽¨)⍣2≥∘i¨⍳⌈/,i←⌊/↑⍳⍴a←⍸⍣¯1(⊢-⌊/)⍸⎕

Try it online!

⍸⍣¯1(⊢-⌊/)⍸ trim surrounding 0s

≥∘i¨⍳⌈/,i←⌊/↑⍳⍴a generate L-shapes

(⍉¨⊢,⌽¨)⍣2 add reflections

(⊂a)∊ test if the (trimmed) input is among them

APL (Dyalog Unicode), 44 bytes

thanks @Adám for the ⍸⍣¯1 trick

(⊂a)∊(⍉¨⊢,⌽¨)⍣2≥∘i¨⍳⌈/,i←⌊/↑⍳⍴a←⍸⍣¯1(⊢-⌊/)⍸⎕

Try it online!

APL (Dyalog Unicode), 44 bytes

thanks @Adám for the ⍸⍣¯1 trick

(⊂a)∊(⍉¨⊢,⌽¨)⍣2≥∘i¨⍳⌈/,i←⌊/↑⍳⍴a←⍸⍣¯1(⊢-⌊/)⍸⎕

Try it online!

⍸⍣¯1(⊢-⌊/)⍸ trim surrounding 0s

≥∘i¨⍳⌈/,i←⌊/↑⍳⍴a generate L-shapes

(⍉¨⊢,⌽¨)⍣2 add reflections

(⊂a)∊ test if the (trimmed) input is among them

Source Link
ngn
  • 15.3k
  • 2
  • 43
  • 87

APL (Dyalog Unicode), 44 bytes

thanks @Adám for the ⍸⍣¯1 trick

(⊂a)∊(⍉¨⊢,⌽¨)⍣2≥∘i¨⍳⌈/,i←⌊/↑⍳⍴a←⍸⍣¯1(⊢-⌊/)⍸⎕

Try it online!