first solution for anagram exercise