Sliding Window | Go
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```golang []\nfunc validSubstringCount(w1 string, w2 string) int64 {\n    \n    f:=make([]int,26)\n    cnt:=0\n    for _,i:= range w2 {\n        if f[i-\'a\']==0 {\n            cnt++\n        }\n        f[i-\'a\']++\n    }\n\n    j:=0;\n    var ans int64 = 0;\n    n:=len(w1)\n    for i:=0;i<n;i++ {\n        k:= w1[i]-\'a\'\n        f[k]--\n        if f[k] == 0 {\n            cnt--\n        }\n\n        for cnt == 0 {\n            ans+=int64(n-i)\n            p:=w1[j]-\'a\'\n            f[p]++\n            if f[p]==1 {\n                cnt++;\n            }\n            j++\n        }\n    }\n    return ans;\n}\n```
['Sliding Window', 'Go']