Sliding  Window 100 beats
Intuition\nSo we will bw doing this problem bu using sliding window approach\n\n\n# Approach\n\nwe have to run a for loop by expanding the right \nnow\nwe just 
# Intuition\nSo we will bw doing this problem bu using sliding window approach\n\n\n# Approach\n\nwe have to run a for loop by expanding the right \nnow\nwe just have to see the point where we are having an alphabet with frequency of k and then we have to count the possibilities of substrings by subtracting the index(at where we found the frequency as k) from total size;\n\nAnd then we have to just remove the frequency of (the left most character by one and have to move the left by one (shrinking the window from left side))\n\n# Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int numberOfSubstrings(string s, int k) {\n        unordered_map <char, int> m;\n        int count=0;\n        int left=0;\n        for (int right =0; right<s.size(); right++){\n            m[s[right]]++;\n            while(m[s[right]]>=k){\n                count += (s.size()-right);\n                m[s[left]]--;\n                left++;\n            }\n\n        }\n        return count;\n    }\n\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//         int maxi=0,count=0;\n//         for (int i=0; i<s.size();i++){\n//            // int count=0;\n//             unordered_map<char,int> m;\n//             for (int j=i; j<s.size();j++){\n//                 m[s[j]]++;\n//             }\n//             for (auto i: m){\n//                 if (i.second>=k){\n//                     count+=1;\n//                     break;\n//                 }\n//             }\n//             //maxi = max(maxi,count);\n//         }\n//         return count;\n//     }\n// };\n```
['Two Pointers', 'Sliding Window', 'C++']