Sliding Window
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: O(26 * n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(c)\uFF0Cc is the types of English letters in a string s.\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```javascript []\n/**\n * @param {string} s\n * @param {number} k\n * @return {number}\n */\nvar numberOfSubstrings = function(s, k) {\n    let times = 0;\n    const charMap = new Map();\n    let l = 0;\n\n    for (let i = 0; i < s.length; i++) {\n        charMap.set(s[i], (charMap.get(s[i]) || 0) + 1);\n        while (Math.max(...Array.from(charMap.values())) >= k) {\n            times += s.length - i;\n            charMap.set(s[l], charMap.get(s[l]) - 1);\n            l++;\n        }\n    }\n\n    return times;\n};\n```
['JavaScript']