Hacker News new | ask | show | jobs
by tuukkah 2981 days ago
To get decent anagram lengths and complexity, implement the numbers as a dict of repetitions of primes, and implement the multiplication by summing the repetitions. ;-)
1 comments

In which case you can just compare the dicts without performing the multiplication (which happens to be the costliest part for arbitrary-precision integers).
Exactly.