Jelly, 20 bytes ³b‘ị“ḃṘ¤’b3¤S ⁴ḊÇÐṀḢ Try it online!
posted 2y ago by steffan153
# [Jelly], 20 bytes ³b‘ị“ḃṘ¤’b3¤S ⁴ḊÇÐṀḢ [Try it online!][TIO-l8nwer4u] [Jelly]: https://github.com/DennisMitchell/jelly [TIO-l8nwer4u]: https://tio.run/##AToAxf9qZWxsef//wrNi4oCY4buL4oCc4biD4bmYwqTigJliM8KkUwrigbThuIrDh8OQ4bmA4bii////MTIz "Jelly – Try It Online"