Skip to main content
1 of 5
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

05AB1E, 63 bytes

„Uuõª„LLæDl«âDí«JêéRʒ®så}нõ.;Ðć_iDćl'xQiA6£Du«м.ïë\7ÝKõQë\þQ}yõÊ*

This isn't too easy without regexes.. :/ Can definitely be golfed a bit more, though.

Try it online or verify all test cases.

Explanation:

TODO: Working on it.

Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384