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

Commonmark migration
Source Link

#Mathematica, (削除) 115 (削除ここまで) 89 bytes

Mathematica, (削除) 115 (削除ここまで) 89 bytes

It takes as input a list of characters [{"a", "b", "c", "d", "a"}] and outputs a list of lists of characters

Thread[PadRight[Table[#,Max@Position[Alphabet[]/."a"->#,#|ToLowerCase@#]]&/@#]/. 0->" "]&

Try it online!

-26 bytes from Misha Lavrov

-5 bytes from user202729

but if you want to see the output as it is in the test case, try this (128 bytes) code
Try it online!

#Mathematica, (削除) 115 (削除ここまで) 89 bytes

It takes as input a list of characters [{"a", "b", "c", "d", "a"}] and outputs a list of lists of characters

Thread[PadRight[Table[#,Max@Position[Alphabet[]/."a"->#,#|ToLowerCase@#]]&/@#]/. 0->" "]&

Try it online!

-26 bytes from Misha Lavrov

-5 bytes from user202729

but if you want to see the output as it is in the test case, try this (128 bytes) code
Try it online!

Mathematica, (削除) 115 (削除ここまで) 89 bytes

It takes as input a list of characters [{"a", "b", "c", "d", "a"}] and outputs a list of lists of characters

Thread[PadRight[Table[#,Max@Position[Alphabet[]/."a"->#,#|ToLowerCase@#]]&/@#]/. 0->" "]&

Try it online!

-26 bytes from Misha Lavrov

-5 bytes from user202729

but if you want to see the output as it is in the test case, try this (128 bytes) code
Try it online!

deleted 399 characters in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87

#Mathematica, 115 bytes

this answer only works on Mathematica (see first comment) because it uses the Unicode character U+221E INFINITY.(削除) 115 (削除ここまで) 89 bytes

It takes as input a list of characters [{"a", "b", "c", "d", "a"}] and outputs a list of lists of characters

Thread[PadRight[Table[#,If[(d=Min@Position[Alphabet[],If[UpperCaseQ@#,ToLowerCase@#,#]])==∞,1Max@Position[Alphabet[]/."a"->#,d]]&#|ToLowerCase@#]]&/@#]/. 0->" "]&

#Wolfram Language (Mathematica), 118 bytesTry it online!

outputs a list of lists of characters-26 bytes from Misha Lavrov

Thread[PadRight[Table[#,If[(d=Min@Position[Alphabet[],If[UpperCaseQ@#,ToLowerCase@#,#]])==\:221e,1,d]]&/@#]/. 0->" "]&

Try it online!

-5 bytes from user202729-5 bytes from user202729

but if you want to see the output as it is in the test case, try this (162128 bytes) code
Try it online! Try it online!

#Mathematica, 115 bytes

this answer only works on Mathematica (see first comment) because it uses the Unicode character U+221E INFINITY.

It takes as input a list of characters [{"a", "b", "c", "d", "a"}] and outputs a list of lists of characters

Thread[PadRight[Table[#,If[(d=Min@Position[Alphabet[],If[UpperCaseQ@#,ToLowerCase@#,#]])==∞,1,d]]&/@#]/. 0->" "]&

#Wolfram Language (Mathematica), 118 bytes

outputs a list of lists of characters

Thread[PadRight[Table[#,If[(d=Min@Position[Alphabet[],If[UpperCaseQ@#,ToLowerCase@#,#]])==\:221e,1,d]]&/@#]/. 0->" "]&

Try it online!

-5 bytes from user202729

but if you want to see the output as it is in the test case, try this (162 bytes) code
Try it online!

#Mathematica, (削除) 115 (削除ここまで) 89 bytes

It takes as input a list of characters [{"a", "b", "c", "d", "a"}] and outputs a list of lists of characters

Thread[PadRight[Table[#,Max@Position[Alphabet[]/."a"->#,#|ToLowerCase@#]]&/@#]/. 0->" "]&

Try it online!

-26 bytes from Misha Lavrov

-5 bytes from user202729

but if you want to see the output as it is in the test case, try this (128 bytes) code
Try it online!

added 18 characters in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87

#Mathematica, 115 bytes

this answer only works on Mathematica (see first comment) because it uses the Unicode character U+221E INFINITY.

It takes as input a list of characters [{"a", "b", "c", "d", "a"}] and outputs a list of lists of characters

Thread[PadRight[Table[#,If[(d=Min@Position[Alphabet[],If[UpperCaseQ@#,ToLowerCase@#,#]])==∞,1,d]]&/@#]/. 0->" "]&

#Wolfram Language (Mathematica), 123118 bytes

outputs a list of lists of characters

Thread[PadRight[Table[#,If[(d=Min@Position[Alphabet[],If[UpperCaseQ@#,ToLowerCase@#,#]])==\[Infinity]==\:221e,1,d]]&/@#]/. 0->" "]&

Try it online!

-5 bytes from user202729

but if you want to see the output as it is in the test case, try this (162 bytes) code
Try it online!

#Mathematica, 115 bytes

this answer only works on Mathematica (see first comment) because it uses the Unicode character U+221E INFINITY.

It takes as input a list of characters [{"a", "b", "c", "d", "a"}] and outputs a list of lists of characters

Thread[PadRight[Table[#,If[(d=Min@Position[Alphabet[],If[UpperCaseQ@#,ToLowerCase@#,#]])==∞,1,d]]&/@#]/. 0->" "]&

#Wolfram Language (Mathematica), 123 bytes

outputs a list of lists of characters

Thread[PadRight[Table[#,If[(d=Min@Position[Alphabet[],If[UpperCaseQ@#,ToLowerCase@#,#]])==\[Infinity],1,d]]&/@#]/. 0->" "]&

Try it online!

but if you want to see the output as it is in the test case, try this (162 bytes) code
Try it online!

#Mathematica, 115 bytes

this answer only works on Mathematica (see first comment) because it uses the Unicode character U+221E INFINITY.

It takes as input a list of characters [{"a", "b", "c", "d", "a"}] and outputs a list of lists of characters

Thread[PadRight[Table[#,If[(d=Min@Position[Alphabet[],If[UpperCaseQ@#,ToLowerCase@#,#]])==∞,1,d]]&/@#]/. 0->" "]&

#Wolfram Language (Mathematica), 118 bytes

outputs a list of lists of characters

Thread[PadRight[Table[#,If[(d=Min@Position[Alphabet[],If[UpperCaseQ@#,ToLowerCase@#,#]])==\:221e,1,d]]&/@#]/. 0->" "]&

Try it online!

-5 bytes from user202729

but if you want to see the output as it is in the test case, try this (162 bytes) code
Try it online!

added 20 characters in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87
Loading
added 72 characters in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87
Loading
added 454 characters in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87
Loading
added 454 characters in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87
Loading
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87
Loading

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