Skip to main content
4 of 4
Rollback to Revision 2
Mr. Xcoder
  • 42.9k
  • 9
  • 87
  • 221

Jelly, 31 bytes

:7+‘µ“ vibgyor”ṁṚ,Ṛjṛ/ƲƤṭ"ḶṚ⁶ẋƲ 

Try it online!

Check out a test suite!

ಠ_ಠ This is overly complicated because Jelly doesn't have a centralize function...

Mr. Xcoder
  • 42.9k
  • 9
  • 87
  • 221