Skip to main content
8 of 9
added 1 character in body; added 37 characters in body
Noodle9
  • 20.3k
  • 3
  • 21
  • 46

Python 2, 82 \$\cdots\$78 77 bytes

Added 2 bytes to fix an error kindly pointed out by S.S. Anne.
Switched to Python 2 thanks to Grimmy.
Saved a byte thanks to @Arnauld!!!

f=lambda s,i=1:i*all((`i*i`+`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