Skip to main content
added 89 characters in body
Source Link
user
  • 387
  • 2
  • 21
  • 68

Haskell, 6161 59 44 bytes

Saved 1 16 bytes thanks to @ovs!

(a:b)%(c:d)|a==c=a:b%d|0<1='*':b%(c:d)b%d
(a_:b)%c='*':b%c
_%_=""e%_=e

Try it online!Try it online!

Haskell, 61 bytes

(a:b)%(c:d)|a==c=a:b%d|0<1='*':b%(c:d)
(a:b)%c='*':b%c
_%_=""

Try it online!

Haskell, 61 59 44 bytes

Saved 1 16 bytes thanks to @ovs!

(a:b)%(c:d)|a==c=a:b%d
(_:b)%c='*':b%c
e%_=e

Try it online!

Source Link
user
  • 387
  • 2
  • 21
  • 68

Haskell, 61 bytes

(a:b)%(c:d)|a==c=a:b%d|0<1='*':b%(c:d)
(a:b)%c='*':b%c
_%_=""

Try it online!