a class to check if two strings are anagrams