Create sets for both the strings. Then for every word in the first set, check if it is present in the set for the second string in Python code example
Example: empty set python
# Distinguish set and dictionary while creating empty set
# initialize a with {}
a = {}
# check data type of a
print(type(a))
# initialize a with set()
a = set()
# check data type of a
print(type(a))