Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Post Undeleted by Razetime
added 27 characters in body
Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

APL (Dyalog Extended), 37 bytes

×ばつ(⊃,⊢/,⊃) ̈{⍵⊂⍨1,1<|21<2-/⍵}⊃∩/⊃ ̈∪/ ̈⊃ ̈ ̈...∨⍤∊ ̈.../ ̈ ̈⎕ ̈ ×ばつ

Try it online! Try it online!

A full program which takes a nested array in STDIN and returns a nested array.

Code fixed by bubbler.

APL (Dyalog Extended), 37 bytes

(⊃,⊢/) ̈{⍵⊂⍨1,1<|2-/⍵}⊃∩/⊃ ̈∪/ ̈⊃ ̈ ̈.../ ̈ ̈⎕

Try it online!

A full program which takes a nested array in STDIN and returns a nested array.

APL (Dyalog Extended), 37 bytes

×ばつ(⊢/,⊃) ̈{⍵⊂⍨1,1<2-/⍵}⊃∩/∨⍤∊ ̈.../ ̈ ×ばつ

Try it online!

A full program which takes a nested array in STDIN and returns a nested array.

Code fixed by bubbler.

Post Deleted by Razetime
Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

APL (Dyalog Extended), 37 bytes

(⊃,⊢/) ̈{⍵⊂⍨1,1<|2-/⍵}⊃∩/⊃ ̈∪/ ̈⊃ ̈ ̈.../ ̈ ̈⎕

Try it online!

A full program which takes a nested array in STDIN and returns a nested array.

AltStyle によって変換されたページ (->オリジナル) /