Count Common Words With One Occurrence Problem

Count Common Words With One Occurrence Problem — ExecCode Easy DSA Practice

Solve the Count Common Words With One Occurrence problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given two string arrays words1 and words2, return the number of strings that appear exactly once in each of the two arrays.

Examples

Input {"words1": ["leetcode", "is", "amazing", "as", "is"], "words2": ["amazing", "leetcode", "is"]}; Output 2. Input {"words1": ["b", "bb", "bbb"], "words2": ["a", "aa", "aaa"]}; Output 0

Constraints

1 <= words1.length, words2.length <= 1000 1 <= words1[i].length, words2[j].length <= 30 words1[i] and words2[j] consists only of lowercase English letters.

Practice Count Common Words With One Occurrence free on ExecCode. Browse DSA problems, topic map, and placement guides.