1class Solution {2public:3vector<string> stringMatching(vector<string> &words) {4vector<string> res; // output56for (int i = 0; i < words.size(); i++) {7for (int j = 0; j < words.size(); j++) {8if (i != j && words[j].find(words[i]) != -1) {9if (!count(res.begin(), res.end(),10words[i])) // if vector result does not include this11// string, push it to vector12res.push_back(words[i]);13else14continue; // if vector result includes this string, ignore15}16}17}1819return res;20}21};