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

saved 1 byte
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

Jelly, 8(削除) 8 (削除ここまで) 7 bytes

A monadic link returning a list of strings.

ḲOr97ỌKYḲOr97ỌK

Try it online! Try it online!

ḲOr97ỌKYḲOr97ỌK - a monadic link taking a string, e.g. "ab c"
Ḳ - split at spaces --> ["ab", "c"]
 O - get ASCII codes --> [[97, 98], [99]]
 r97 - build descending range to 97 --> [[[97], [98, 97]], [[99, 98, 97]]]
 Ọ - turn back into ASCII --> [["a", "ba"], ["cba"]]
 K - join with spaces --> ["a", "ba", " ", "cba"]
 Y - join with linefeeds

Jelly, 8 bytes

ḲOr97ỌKY

Try it online!

ḲOr97ỌKY - a monadic link taking a string, e.g. "ab c"
Ḳ - split at spaces --> ["ab", "c"]
 O - get ASCII codes --> [[97, 98], [99]]
 r97 - build descending range to 97 --> [[[97], [98, 97]], [[99, 98, 97]]]
 Ọ - turn back into ASCII --> [["a", "ba"], ["cba"]]
 K - join with spaces --> ["a", "ba", " ", "cba"]
 Y - join with linefeeds

Jelly, (削除) 8 (削除ここまで) 7 bytes

A monadic link returning a list of strings.

ḲOr97ỌK

Try it online!

ḲOr97ỌK - a monadic link taking a string, e.g. "ab c"
Ḳ - split at spaces --> ["ab", "c"]
 O - get ASCII codes --> [[97, 98], [99]]
 r97 - build descending range to 97 --> [[[97], [98, 97]], [[99, 98, 97]]]
 Ọ - turn back into ASCII --> [["a", "ba"], ["cba"]]
 K - join with spaces --> ["a", "ba", " ", "cba"]
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

Jelly, 8 bytes

ḲOr97ỌKY

Try it online!

ḲOr97ỌKY - a monadic link taking a string, e.g. "ab c"
Ḳ - split at spaces --> ["ab", "c"]
 O - get ASCII codes --> [[97, 98], [99]]
 r97 - build descending range to 97 --> [[[97], [98, 97]], [[99, 98, 97]]]
 Ọ - turn back into ASCII --> [["a", "ba"], ["cba"]]
 K - join with spaces --> ["a", "ba", " ", "cba"]
 Y - join with linefeeds

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