Meta Interview Question

(python) Given two sentences, construct an array that has the words that appear in one sentence and not the other.

Interview Answers

Anonymous

Apr 18, 2020

Other than the statement above, I had to use `assert` statements to understand how to code the base cases.

Anonymous

Apr 21, 2020

#string to list s1 = 'yes no maybe' print(s1.split()) #list to string l1 = ['yes','no','maybe'] print(''.join(l1))

Anonymous

Jun 16, 2020

string1 = "Firstly this is the first string" string2 = "Next is the second string" s1 = set(string1.split()) s2 = set(string2.split()) ls = sorted(list(s1.symmetric_difference(s2))) print("common words list: ",s1&s2) print("uncommon words list: ",ls)