edited body
Source Link
Martin Ender
  • 192k
  • 63
  • 427
  • 940

Retina, 3737 32 bytes

$
aa
(T`_l`l`.$
)`1(a.*)\B
$1$'$1$1$1
z$z

The trailing linefeed is significant. Input is taken in unary.

Try it online!Try it online!

Retina, 37 bytes

$
aa
(T`_l`l`.$
)`1(a.*)\B
$1$'$1
z$

The trailing linefeed is significant. Input is taken in unary.

Try it online!

Retina, 37 32 bytes

$
aa
(T`_l`l`.$
)`1(a.*)
$1$1
z

The trailing linefeed is significant. Input is taken in unary.

Try it online!

Source Link
Martin Ender
  • 192k
  • 63
  • 427
  • 940

Retina, 37 bytes

$
aa
(T`_l`l`.$
)`1(a.*)\B
$1$'$1
z$

The trailing linefeed is significant. Input is taken in unary.

Try it online!