[old] Common Words [old] Common Words
Undefined
English ES FR HU IT JA RU UK
mirror

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.

You should be an authorized user in order to see the full description and start solving this mission.