5 ms·
Works if you assign prime numbers to each letter and multiply instead. So a=2, b=3, etc.
by tylerhou 9y ago
Works if you assign prime numbers to each letter and multiply instead. So a=2, b=3, etc.
- tuukkah 9y agoTo get decent anagram lengths and complexity, implement the numbers as a dict of repetitions of primes, and implement the multiplication by summing the repetitions. ;-)