Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
The Counter Trick! solution in Clear category for Verify Anagrams by dig
from collections import Counter
def verify_anagrams(a: str, b: str) -> bool:
a= a.lower().replace(" ", "")
b= b.lower().replace(" ", "")
return Counter(a)==Counter(b)
print("Example:")
print(verify_anagrams("Programming", "Gram Ring Mop"))
assert verify_anagrams("Programming", "Gram Ring Mop") == True
assert verify_anagrams("Hello", "Ole Oh") == False
assert verify_anagrams("Kyoto", "Tokyo") == True
print("The mission is done! Click 'Check Solution' to earn rewards!")
Feb. 13, 2023
Comments: