Let's continue examining words. You are given two string with words separated by commas. Try to find what is common between these strings. The words are not repeated in the same string.
Your function should find all of the words that...
Two arguments as strings.
The common words as a string.
commonWords("hello,world", "hello,earth") == "hello" commonWords("one,two,three", "four,five,six") == "" commonWords("one,two,three", "four,five,one,two,six,three") == "one,three,two"
Here you can learn how to work with strings and sets. This knowledge can be useful for linguistic analysis.
Each string contains no more than 10 words.
All words separated by commas.
All words consist of lowercase latin letters.