class Solution {
public:
vector<string> splitWordsBySeparator(vector<string>& words, char separator) {
vector<string> res;
for (const string& word : words) {
istringstream iss(word);
string sub;
while (getline(iss, sub, separator)) {
if (!sub.empty())
res.emplace_back(sub);
}
}
return res;
}
};