Skip to main content
1 of 7
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Jelly, 24 bytes

ZLpLµS€©-*×Ḣ€+ȷ×®¤Ụị³ZF¤ 

Try it online!

Dennis
  • 211.7k
  • 41
  • 380
  • 830