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

added 124 characters in body
Source Link
Shaggy
  • 45k
  • 4
  • 39
  • 95
p-pUÎÊ+6)cU¬èd Æ'|i|úUÎÊ+3\nûô@S+i|i|úUÎÊ+3ÃvÈç-\nû :Implicit input of array U
p c :PushConcatenate
 -p  : "-"Join repeatedU
 this many times
èd  : Count the "d"s
 : Firstô element of U
 Ê : Range [0,count]
 @ : Length : Map
 +6 S : Plus 6Space
 ) + :End push
 Append
 c i  :Concatenate
 A space prepended with
  |i  : Join U
 A "|" prepended with
 èd  : Count the "d"s
 A "|" right padded with spaces to length
 Æ UÎÊ+3 : Map the range [0,count)
 Length of first element of U plus 3
 '|i : Ã Prepend a "|" with :End map
  v :Modify first element
 A "|" right padded with spaces to length
 È UÎÊ+3:By passing it through the following function
 : Length of first element of U plus 3
 ç- : Fill with "-"
  \n :Reassign to U (saves a byte over having to close all the nested methods)
 û :Centre pad each element with spaces to the length of the longest
p-pUÎÊ+6)cU¬èd Æ'|i|úUÎÊ+3\nû :Implicit input of array U
p  :Push
 -p : "-" repeated this many times
  : First element of U
 Ê : Length
 +6 : Plus 6
 ) :End push
 c :Concatenate
  : Join U
 èd : Count the "d"s
 Æ : Map the range [0,count)
 '|i : Prepend a "|" with
  : A "|" right padded with spaces to length
 UÎÊ+3 : Length of first element of U plus 3
 \n :Reassign to U (saves a byte over having to close all the nested methods)
 û :Centre pad each element with spaces to the length of the longest
cU¬èd ô@S+i|i|úUÎÊ+3ÃvÈç-\nû :Implicit input of array U
c :Concatenate
  : Join U
 èd : Count the "d"s
 ô : Range [0,count]
 @  : Map
 S : Space
 + : Append
 i  : A space prepended with
 |i  : A "|" prepended with
  :  A "|" right padded with spaces to length
 UÎÊ+3 : Length of first element of U plus 3
 Ã  :End map
 v :Modify first element
 È :By passing it through the following function
 ç- : Fill with "-"
  \n :Reassign to U (saves a byte over having to close all the nested methods)
 û :Centre pad each element with spaces to the length of the longest
added 1 character in body
Source Link
Shaggy
  • 45k
  • 4
  • 39
  • 95

Japt, (削除) 30 (削除ここまで) 28 (削除) 28 (削除ここまで) 27 bytes

p-pUÎÊ+6)cU¬èd Æ'|i|úUÎÊ+3ô@S+i|i|úUÎÊ+3ÃvÈç-
û

Try it Try it or run all test cases run all test cases

Japt, (削除) 30 (削除ここまで) 28 bytes

p-pUÎÊ+6)cU¬èd Æ'|i|úUÎÊ+3
û

Try it or run all test cases

Japt, (削除) 30 (削除ここまで) (削除) 28 (削除ここまで) 27 bytes

cU¬èd ô@S+i|i|úUÎÊ+3ÃvÈç-
û

Try it or run all test cases

added 469 characters in body
Source Link
Shaggy
  • 45k
  • 4
  • 39
  • 95
added 1072 characters in body
Source Link
Shaggy
  • 45k
  • 4
  • 39
  • 95
Loading
Source Link
Shaggy
  • 45k
  • 4
  • 39
  • 95
Loading

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