Browse and solve 1,200+ machine learning coding challenges on Deep-ML. Filter by difficulty (beginner, intermediate, advanced) and category (linear algebra, machine learning, deep learning, NLP, computer vision). Write Python solutions in the browser and get instant feedback against test cases.
You are given two lists of strings, list1 and list2. Return the number of distinct words that appear exactly one time in list1 AND also appear exactly one time in list2.
A word qualifies only if its total occurrence count is exactly 1 in list1 and exactly 1 in list2. Return the count of such words as an integer.
list1 = ['apple', 'banana', 'apple', 'cherry'] list2 = ['banana', 'cherry', 'date', 'cherry']
1
In list1 the words appearing exactly once are banana and cherry (apple appears twice). In list2 the words appearing exactly once are banana and date (cherry appears twice). The only word that appears exactly once in both lists is banana, so the answer is 1.