Sha256: a0ae9a3f7d88eee61daed5cab2af8b683b32e7dbefc0b0b1019550b0e8d8ef86
Contents?: true
Size: 405 Bytes
Versions: 396
Compression:
Stored size: 405 Bytes
Contents
class Anagram constructor: (source) -> @source = source match: (targets) -> (target.toLowerCase() for target in targets when areAnagrams(@source, target)) areAnagrams = (word1, word2) -> return false if word1.toLowerCase() == word2.toLowerCase() standardForm(word1) == standardForm(word2) standardForm = (word) -> word.toLowerCase().split("").sort().join() module.exports = Anagram
Version data entries
396 entries across 396 versions & 1 rubygems