I was interested in the Code Golf challange about simple text. The spec is:Write a function that from a text returns the non-common words.I assumed non clean input so I cleaned it before proceding.The 'foo' 'barz' list is for easier testing. You may uncomment the line to read from a file.LETTERS = ('a'..'z').to_aSIMPLE_WORDS = ['foo', 'barz'] # File.read('words.txt').split(\n)def non_common(text)  text    .downcase    .chars    .map { |char| LETTERS.include?(char) ? char : ' ' }    .select { |char| LETTERS.include?(char) || char == ' '}    .join    .squeeze(' ')    .split(' ')    .select { |word| SIMPLE_WORDS.include?(word) }endp non_common('''djsh sjsfoo hsh^#^^@susns  dhd  djs d   #&#&@&  barz  e &2@&foo barz''')
Simplicity decider
ruby;file