ruby anagram version 3