Skip to main content
1 of 8
Arnauld
  • 197.7k
  • 20
  • 179
  • 650

JavaScript (ES6), 83 bytes

f=(a,b=[...new Set(a)],p='')=>b.every((v,i)=>a.match(p)&&f(a,b.filter(_=>i--),p+v))

Try it online!

Arnauld
  • 197.7k
  • 20
  • 179
  • 650