Skip to main content
1 of 3
R. Kap
  • 4.9k
  • 2
  • 15
  • 37

dc, 70 bytes

?sa0sb1sc[lc4+sc]sh[lbZ+sc]so[lcdlb1+ddsb3%0=h5%0=hlcrlc=ola>y]dsyxlbp

Try it online!

R. Kap
  • 4.9k
  • 2
  • 15
  • 37