Two methods to check if two strings are anagrams