Sunday, September 13, 2009

What animal letters add up to 100

My friend's daughter had an assignment to find three animals which letters will add up to a hundred, "A" being one, "B" two, etc. After hours of adding they found two of the names, that is when I've heard of this problem. Well, I've cheated and used Clojure and fifteen minutes later I've got this


It was fun to write. Maybe I'll use it as an interview question :)
By the way the answer is:
([Chimpanzee 100] [Starfish 100] [Turkey 100])

[Update: The new assignment was to find as many words in the dictionary as possible with the same requirement. I hacked the code to find all the 2296 words in the words file on my machine. The gist is in the same place.]