4 ms·
I don't see how the sum would be unique to a particular combination of letters.
by aquateen 8y ago
I don't see how the sum would be unique to a particular combination of letters.
- LyndsySimon 8y ago“ad” = “bc” You’re right.
- jcadam 8y agoI briefly mused about just summing the ASCII codes for each letter in the strings. But quickly discarded the idea for this reason :)
- tylerhou 8y agoWorks if you assign prime numbers to each letter and multiply instead. So a=2, b=3, etc.
- tuukkah 8y 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. ;-)
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- D_Alex 8y agoWhat if a=1, b=10, c=100 - etc? Assuming the strings were English words...