leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
2942.cpp (322B)
0 class Solution { 1 public: 2 vector<int> findWordsContaining(const vector<string> &words, char x) const { 3 vector<int> res; 4 5 for (int i = 0; i < size(words); i++) { 6 if (words[i].find(x) != string::npos) { 7 res.push_back(i); 8 } 9 } 10 11 return res; 12 } 13 };