leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

2942.cpp (322B)


      1 class Solution {
      2   public:
      3     vector<int> findWordsContaining(const vector<string> &words, char x) const {
      4         vector<int> res;
      5 
      6         for (int i = 0; i < size(words); i++) {
      7             if (words[i].find(x) != string::npos) {
      8                 res.push_back(i);
      9             }
     10         }
     11 
     12         return res;
     13     }
     14 };