Simple C++ Solution ✅✅
Code\ncpp []\nclass Solution {\npublic:\n    int numberOfSubstrings(string s, int k) {\n        int n=s.length();\n        int ans=0;\n        for(int i=0;i<n;i
# Code\n```cpp []\nclass Solution {\npublic:\n    int numberOfSubstrings(string s, int k) {\n        int n=s.length();\n        int ans=0;\n        for(int i=0;i<n;i++){\n            unordered_map<char,int> mp;\n            for(int j=i;j<n;j++){\n                mp[s[j]]++;\n                if(mp[s[j]]>=k){\n                    ans+=(n-j);\n                    break;\n                }\n            }\n        }\n        return ans;\n    }\n};\n```
['C++']