Easy C++ solution -- O(n) -- 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:\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 left = 0, right = 0;\n        vector<int> check(26, 0);\n\n        int ans = 0;\n        while(right < s.size()){\n            check[s[right]-\'a\']++;\n            while(check[s[right]-\'a\'] >= k && left <= right){\n                ans += s.size() - right;\n                check[s[left]-\'a\']--;\n                left++;\n            }\n            right++;\n        }\n        return ans;\n    }\n};\n```
['C++']