C++ | 100% beats
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 []\nclass Solution {\npublic:\n    int numberOfSubstrings(string s, int k) {\n        int ans = 0;\n        unordered_map<char, int> mp;\n         int l = 0;  \n        for (int r = 0; r < s.size(); r++) {\n            mp[s[r]]++;\n            while (mp[s[r]] >= k) {\n                ans += s.size() - r;  \n                mp[s[l]]--;  \n                l++;  \n            }\n        }\n\n        return ans;\n    }\n};\n\n```
['C++']