Skip to main content
added 84 characters in body
Source Link
Nahuel Fouilleul
  • 8.6k
  • 1
  • 10
  • 18

Perl, 3434 38 + 1 bytes

to handle the two cases

s,(/)|.,$"x($1?$c&&--$c:$c++).$&.$/,ge

to be run with -p option

s,(/)|.,$"x($1?--$c:$c++).$&.$/,ge

EDIT: following comment doesn't work when first character is /

s,(/)|.,$"x($1?$c--:++$c).$&.$/,ge

however output will be shifted one character on the right if first char is \

Perl, 34 + 1 bytes

to be run with -p option

s,(/)|.,$"x($1?--$c:$c++).$&.$/,ge

EDIT: following comment doesn't work when first character is /

s,(/)|.,$"x($1?$c--:++$c).$&.$/,ge

however output will be shifted one character on the right if first char is \

Perl, 34 38 + 1 bytes

to handle the two cases

s,(/)|.,$"x($1?$c&&--$c:$c++).$&.$/,ge

to be run with -p option

s,(/)|.,$"x($1?--$c:$c++).$&.$/,ge

EDIT: following comment doesn't work when first character is /

s,(/)|.,$"x($1?$c--:++$c).$&.$/,ge

however output will be shifted one character on the right if first char is \

added 196 characters in body
Source Link
Nahuel Fouilleul
  • 8.6k
  • 1
  • 10
  • 18

Perl, 34 + 1 bytes

to be run with -p option

s,(/)|.,$"x($1?--$c:$c++).$&.$/,ge

EDIT: following comment doesn't work when first character is /

s,(/)|.,$"x($1?$c--:++$c).$&.$/,ge

however output will be shifted one character on the right if first char is \

Perl, 34 + 1 bytes

to be run with -p option

s,(/)|.,$"x($1?--$c:$c++).$&.$/,ge

Perl, 34 + 1 bytes

to be run with -p option

s,(/)|.,$"x($1?--$c:$c++).$&.$/,ge

EDIT: following comment doesn't work when first character is /

s,(/)|.,$"x($1?$c--:++$c).$&.$/,ge

however output will be shifted one character on the right if first char is \

Source Link
Nahuel Fouilleul
  • 8.6k
  • 1
  • 10
  • 18

Perl, 34 + 1 bytes

to be run with -p option

s,(/)|.,$"x($1?--$c:$c++).$&.$/,ge