5 ms·
Posts like this are why I love HN. I recently wrote a program to find anagrams of a given string (a Countdown solver if you live in the UK). It includes a real
by helicon 9y ago
Posts like this are why I love HN. I recently wrote a program to find anagrams of a given string (a Countdown solver if you live in the UK).
It includes a really naive method for generating all possible permutations of the string, but reading this post I can immediately see a far better way to do it.
That's my weekend taken care of! thanks to the poster and author.
- forinti 9y agoThere was a recent post about anagrams and the author just put all the letters in alphabetical order and then compared the words, which was more efficient than generating permutations.
- NegativeLatency 9y agoSounds interesting, do you have a link?
- forinti 9y agohttp://blog.plover.com/lang/anagram-scoring.html http://blog.plover.com/lang/anagram-scoring.html
- hfsktr 9y agoThat is what I did for this challenge: https://www.reddit.com/r/dailyprogrammer/comments/52enht/20160912_challenge_283_easy_anagram_detector/ https://www.reddit.com/r/dailyprogrammer/comments/52enht/201... https://github.com/Rhebel/DailyProgrammer/blob/master/DailyProgrammerCodes/Models/Challenge283E.cs https://github.com/Rhebel/DailyProgrammer/blob/master/DailyP... I know my code is super verbose compared to other people's but I'd rather be understood than clever.
- Johnny_Brahms 9y agoI ran an anagram website in the 90s, and that was what we did. We stored word lists with a key of all their letters sorted. We then calculated anagram scores on demand because I couldn't work out a nice enough way to store those. We had about 300 hits/day so it didn't matter.
- wyldfire 9y ago"Good morning, that's a nice tnettenba." [1] [1] https://www.youtube.com/watch?v=lsFAokXCxTI https://www.youtube.com/watch?v=lsFAokXCxTI