Very Easy to understand Solution || C++
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\n#define ll long long\nclass Solution {\npublic:\n\n    bool chk(vector<int> &m1, vector<int> &m2) {\n        for(int i = 0 ; i < 26 ; i++) {\n            if(m1[i] < m2[i]) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    long long validSubstringCount(string s1, string s2) {\n        if(s2.size() > s1.size()) return 0LL;\n        vector<int> m1(26, 0), m2(26, 0);\n        for(char i : s2) {\n            m2[i-\'a\']++;\n        }\n        int n = s1.size();\n        int z = s2.size();\n        int last = 0;\n        ll ans = 0;\n        for(int i = 0 ; i < n ; i++) {\n            char c = s1[i];\n            m1[c-\'a\']++;\n            if(chk(m1, m2)) {\n                while(chk(m1, m2)) {\n                    ans += n-i;\n                    if(last < n) m1[s1[last]-\'a\']--;\n                    last++;\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']