Scala Sentence Anagrams code