Compass interview question

find the matching words from string