most easy solution
Intuition\n Describe your first thoughts on how to solve this problem. \n...\n\n# Approach\n Describe your approach to solving the problem. \nthis will be one o
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n...\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nthis will be one of the most simple solution\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nn\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nn\n\n# Code\n```python []\ndef is_valid(w1, w2):\n    for i in w2:\n        if i in w1:\n            if w1[i]>= w2[i]:\n                continue\n            else:\n                return False\n        else:\n            return False\n    return True\nclass Solution(object):\n    def validSubstringCount(self, word1, word2):\n        if len(word1) < len(word2):\n            return 0\n        dic2 = {}\n        for i in word2:\n            if i in dic2:\n                dic2[i] += 1\n            else:\n                dic2[i] = 1\n        dic1 = {}\n        for i in range(len(word2)):\n            if word1[i] in dic1:\n                dic1[word1[i]] += 1\n            else:\n                dic1[word1[i]] = 1\n\n        ans = 0\n\n        l = 0\n        r = len(word2) - 1\n\n        while r < len(word1):\n            if is_valid(dic1, dic2):\n\n                ans += len(word1) - r\n\n                dic1[word1[l]] -= 1\n                if dic1[word1[l]] == 0:\n                    del dic1[word1[l]]\n                l += 1\n            else:\n                r += 1\n                if r < len(word1):\n                    if word1[r] in dic1:\n                        dic1[word1[r]] += 1\n                    else:\n                        dic1[word1[r]] = 1\n\n        return ans\n```
['Python']