checks if two strings are anagrams of each other