Skip to main content
added 29 characters in body
Source Link
Neil
  • 177.2k
  • 12
  • 74
  • 281

Retina, 41 bytes

"$+"+%Lw$`"$&"+%Lw$`,.*(.)
$`$1$&$'
\d|,.+

A`(.)\1

Try it online! NoTry it online! Link includes test suite due to the way the program uses historycases. Takes comma-separated input. Explanation:

"$+"+`"$&"+`

Repeat n times...

%Lw$`,.*(.)
$`$1$&$'

Replicate each line for each letter of L but inserting a copy of the letter before the comma.

\d|,.+

Remove the copies of n and L.

A`(.)\1

Remove all lines with duplicate adjacent letters.

Retina, 41 bytes

"$+"+%Lw$`,.*(.)
$`$1$&$'
\d|,.+

A`(.)\1

Try it online! No test suite due to the way the program uses history. Takes comma-separated input. Explanation:

"$+"+`

Repeat n times...

%Lw$`,.*(.)
$`$1$&$'

Replicate each line for each letter of L but inserting a copy of the letter before the comma.

\d|,.+

Remove the copies of n and L.

A`(.)\1

Remove all lines with duplicate adjacent letters.

Retina, 41 bytes

"$&"+%Lw$`,.*(.)
$`$1$&$'
\d|,.+

A`(.)\1

Try it online! Link includes test cases. Takes comma-separated input. Explanation:

"$&"+`

Repeat n times...

%Lw$`,.*(.)
$`$1$&$'

Replicate each line for each letter of L but inserting a copy of the letter before the comma.

\d|,.+

Remove the copies of n and L.

A`(.)\1

Remove all lines with duplicate adjacent letters.

Source Link
Neil
  • 177.2k
  • 12
  • 74
  • 281

Retina, 41 bytes

"$+"+%Lw$`,.*(.)
$`$1$&$'
\d|,.+

A`(.)\1

Try it online! No test suite due to the way the program uses history. Takes comma-separated input. Explanation:

"$+"+`

Repeat n times...

%Lw$`,.*(.)
$`$1$&$'

Replicate each line for each letter of L but inserting a copy of the letter before the comma.

\d|,.+

Remove the copies of n and L.

A`(.)\1

Remove all lines with duplicate adjacent letters.