Skip to main content
1 of 9
Noodle9
  • 20.3k
  • 3
  • 21
  • 46

Python 3, 82 bytes

lambda s,i=1:i*all((str(i*i)+str(i**3)).count(c)>=s.count(c)for c in s)or f(s,i+1)

Try it online!

Noodle9
  • 20.3k
  • 3
  • 21
  • 46