Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
1 vote

Borders of a Rectangular Matrix

Pip -xp, 11 bytes L4PDQ R:Z:a Outputs (up to) four lists: down the left border, then right-to-left along the top border, then ...
DLosc's user avatar
  • 39.5k
1 vote

Borders of a Rectangular Matrix

Perl 5, 55 bytes sub{grep/./,@{shift@_},@{pop@_},map{(pop@$_),$$_[0]}@_} Try it online!
Xcali's user avatar
  • 15.1k

Only top scored, non community-wiki answers of a minimum length are eligible