[Facebook data engineer coding] find uncommon words between 2 strings.

Data Science Interview QuestionsCategory: Data Engineer Coding[Facebook data engineer coding] find uncommon words between 2 strings.
1 Answers
MockInterview Staff answered 2 months ago

(please indent properly before running, Python implementation below) 
def uncommon_words(str1,str2):
set_1 = set(str1.split(‘ ‘))
set_2 = set(str2.split(‘ ‘))
difference = (set_1 – set_2) | (set_2 – set_1)
return list(difference)


[Content Sponsor #1] Start learning through a free trial on Datacamp!
[Content Sponsor #2] $750 discount on any springboard courses including Data Science Career Track which comes with a Job Guarantee!

Your Answer

16 + 8 =

Data Science Career Bootcamp