C++ | beats 99% |  easy & understandable |  Memoization using maps |
Please upvote if you like it. Thanks :)\n\n\nclass Solution {\npublic:\n    int numMatchingSubseq(string s, vector<string>& words) {\n        int ans = 0;\n    
**Please upvote if you like it. Thanks :)**\n\n```\nclass Solution {\npublic:\n    int numMatchingSubseq(string s, vector<string>& words) {\n        int ans = 0;\n        int l1 = s.length(); //declare the length of main string\n        map<string,int> m;  // declare a map to store the results of subsquences already checked\n        for (auto word: words){\n            int l2 = word.length(); // declare length of current word\n            int j = 0;\n            if (m.find(word)==m.end()){ // Check for subsequence if current word not found in map\n               for (int i=0;i<l1 && j<l2;i++){   // if we reach end of current word, it means subsequence found. Hence no need to check further\n                    if (s[i]==word[j]){\n                        j++;\n                    }\n                }\n                ans+=(j==l2); // check if we reach end of the word \n                m[word] = (j==l2);\n            }\n            else{\n                ans+= m[word]; // If word is already checked before, no need to check again\n            }\n            \n            \n        }\n        return ans;\n    }\n};\n```
['Memoization', 'C']