Skip to main content
deleted 8 characters in body
Source Link
Xcali
  • 16.2k
  • 2
  • 15
  • 39

Perl 5, 7067 bytes

sub{map{[grep$_,map{shift@$_shift@{$_[-$_]}reverse@_[0}-$_..$_]]0]}0..$#_,($#_)x$#{$_[0]}}

Try it online!Try it online!

Perl 5, 70 bytes

sub{map{[grep$_,map{shift@$_}reverse@_[0..$_]]}0..$#_,($#_)x$#{$_[0]}}

Try it online!

Perl 5, 67 bytes

sub{map{[grep$_,map{shift@{$_[-$_]}}-$_..0]}0..$#_,($#_)x$#{$_[0]}}

Try it online!

Source Link
Xcali
  • 16.2k
  • 2
  • 15
  • 39

Perl 5, 70 bytes

sub{map{[grep$_,map{shift@$_}reverse@_[0..$_]]}0..$#_,($#_)x$#{$_[0]}}

Try it online!