C++ | Simple solution | Hashmap | isSubSequence
\nclass Solution {\n    int isSubSeq(string& a, string b) {\n        \n        int i = 0, j = 0;\n        int m = a.length(), n = b.length();\n        \n       
```\nclass Solution {\n    int isSubSeq(string& a, string b) {\n        \n        int i = 0, j = 0;\n        int m = a.length(), n = b.length();\n        \n        while (i < m && j < n) {\n            if (a[i] == b[j]) {\n                i++; j++;\n            } else {\n                i++;\n            }\n        }\n        \n        return (j == n);\n    }\npublic:\n    int numMatchingSubseq(string S, vector<string>& words) {\n        \n        int c = 0;\n        unordered_map<string, int>mp;\n        for (int i = 0; i < words.size(); i++)\n            mp[words[i]]++;\n            \n        for (auto it = mp.begin(); it != mp.end(); it++) {\n            if (isSubSeq(S, it->first))\n                c += it->second;\n        }\n        \n        return c;\n    }\n};\n```
[]