Sliding Window || Hashing || Super Simple
Code\ncpp []\nclass Solution \n{\npublic:\n    long long validSubstringCount(string word1, string word2) \n    {\n        map<char,long long> m1, m2;\n        f
# Code\n```cpp []\nclass Solution \n{\npublic:\n    long long validSubstringCount(string word1, string word2) \n    {\n        map<char,long long> m1, m2;\n        for(auto ch: word2) m2[ch]++;\n        long long cnt=0, target=m2.size();\n        long long start=0, ans=0, end=0;\n        while(end<word1.size())\n        {\n            m1[word1[end]]++;\n            if(m1[word1[end]]==m2[word1[end]]) cnt++;\n            while(cnt==target)\n            {\n                ans+=(word1.size()-end);\n                m1[word1[start]]--;\n                if(m1[word1[start]]<m2[word1[start]]) cnt--;\n                start++;\n            }\n            end++;\n        }\n        return ans;\n    }\n};\n\n```
['Hash Table', 'Sliding Window', 'C++']