3 ms·
One might also choose not to bring in a BigNum library if you don't need to find every anagram. Here's an exhaustive list of anagrams I found with sorting and c
by brlewis 8y ago
One might also choose not to bring in a BigNum library if you don't need to find every anagram. Here's an exhaustive list of anagrams I found with sorting and comparing that a quick Fundamental Theorem implementation missed:
[ 'basiparachromatin', 'Marsipobranchiata' ]
[ 'configurationism', 'misconfiguration' ]
[ 'constructionism', 'misconstruction' ]
[ 'pericardiacophrenic', 'phrenicopericardiac' ]
[ 'anatomicophysiologic', 'physiologicoanatomic' ]
[ 'petrographically', 'pterylographical' ]
- brlewis 8y agoNote this is out of 20K anagrams. Here's my code: https://github.com/brlewis/brlewis.github.io/blob/master/2018/anag.js https://github.com/brlewis/brlewis.github.io/blob/master/201... On my machine, Fundamental Theorem of Arithmetic finished in 1.703 seconds, sorting letters in 1.954 seconds.