input: Write a python function to check if two strings are anagrams.
  assert check_anagrams("Dormitory", "Dirty room") == True
  assert check_anagrams("Hello", "Olelh") == True
  assert check_anagrams("Test", "Taste") == False
  assert check_anagrams("A gentleman", "Elegant man") == True
output: def check_anagrams(str1, str2):
      # Remove spaces and convert to lowercase
      str1 = str1.replace(" ", "").lower()
      str2 = str2.replace(" ", "").lower()
      
      # Check if sorted characters of both strings are equal
      return sorted(str1) == sorted(str2)