Sliding Window || easy
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\n#define ll long long\nclass Solution {\npublic:\n    bool comp(map<char,int> &mp,map<char,int> &temp)\n    {\n        for(auto &it:mp){if(it.second>temp[it.first]){return false;}}\n        return true;\n    }\n    long long validSubstringCount(string w1, string w2) {\n        map<char,int> mp,temp;\n        for(auto &it:w2){mp[it]++;}\n        ll n=w1.length(),l=w2.length();\n        ll i=0,j=0,ans=0;\n        while(j<n)\n        {    \n            if(j-i+1<l)\n            {\n                temp[w1[j]]++;\n                j++;\n            }\n            else\n            {\n                temp[w1[j]]++;\n                while(comp(mp,temp))\n                {\n                    ans+=(n-j);\n                    temp[w1[i]]--;\n                    if(temp[w1[i]]==0){temp.erase(w1[i]);}\n                    i++;\n                }\n                j++;\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']