count substrings with k frequency characters using javascript
Intuition\nGiven a string s and an integer k, return the total number of \nsubstrings of s where at least one character appears at least k times.\n\n# Approach\
# Intuition\nGiven a string s and an integer k, return the total number of \nsubstrings of s where at least one character appears at least k times.\n\n# Approach\nrun nested loop to generate all possible substrings and then store them in hashmap on every iteration.\n\nif the count of the any character in substring equals or exceeds "k" frequency, then update counter.\n\nfinally return the counter value\n\n# Complexity\n- Time complexity:\nO(N2)\n\n- Space complexity:\nO(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    \n    let count = 0;\n \n    for(let i=0;i<s.length;i++) {\n        let obj = new Map();\n       for(let j=i;j<s.length;j++) {\n            obj.set(s[j], (obj.get(s[j]) || 0) +1);\n             for (let value of obj.values()) {\n                if(value >= k) {\n                    count ++;\n                    break;\n                }\n            }\n        }\n        \n    }\n\n    return count;\n};\n```
['JavaScript']