initial answer to anagram in scala