Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Verify Anagrams by sebastian009
def verify_anagrams(first_word, second_word):
first_word = first_word.replace(" ","")
second_word = second_word.replace(" ","")
first_word = first_word.lower()
second_word = second_word.lower()
alist1 = list(first_word)
alist2 = list(second_word)
alist1.sort()
alist2.sort()
pos = 0
matches = True
if len(alist1)!=len(alist2):
matches = False
while pos < len(first_word) and matches:
if alist1[pos]==alist2[pos]:
pos = pos + 1
else:
matches = False
return matches
Oct. 28, 2016