Skip to main content
edited body
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161

05AB1E, 7 bytes

ι and have been added since this challenge was posted, both of them save bytes here.

Sι`R.ιJ

Try it online!

If we were allowed to take a list of string of length 1, ι`R.ιι`R.ι would work for 5 bytes.

S         # split the string into a list of characters
 ι        # uninterleave: push [even indices, odd indices]
  `       # push both values seperately to the stack
   R      # reverse the odd indices
    .ι    # interleave the two lists
      J   # join into a string

05AB1E, 7 bytes

ι and have been added since this challenge was posted, both of them save bytes here.

Sι`R.ιJ

Try it online!

If we were allowed to take a list of string of length 1, ι`R.ι would work for 5 bytes.

S         # split the string into a list of characters
 ι        # uninterleave: push [even indices, odd indices]
  `       # push both values seperately to the stack
   R      # reverse the odd indices
    .ι    # interleave the two lists
      J   # join into a string

05AB1E, 7 bytes

ι and have been added since this challenge was posted, both of them save bytes here.

Sι`R.ιJ

Try it online!

If we were allowed to take a list of string of length 1, ι`R.ι would work for 5 bytes.

S         # split the string into a list of characters
 ι        # uninterleave: push [even indices, odd indices]
  `       # push both values seperately to the stack
   R      # reverse the odd indices
    .ι    # interleave the two lists
      J   # join into a string
Source Link
ovs
  • 60.6k
  • 3
  • 47
  • 161

05AB1E, 7 bytes

ι and have been added since this challenge was posted, both of them save bytes here.

Sι`R.ιJ

Try it online!

If we were allowed to take a list of string of length 1, ι`R.ι would work for 5 bytes.

S         # split the string into a list of characters
 ι        # uninterleave: push [even indices, odd indices]
  `       # push both values seperately to the stack
   R      # reverse the odd indices
    .ι    # interleave the two lists
      J   # join into a string