That's Easy
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nJust follow the provide
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nJust follow the provided hint\nThen hit the brute force\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```java []\nJAT\nclass Solution {\n    public int numberOfSubstrings(String s, int k) {\n        int n=s.length();\n        if(k==1)\n        return (n*(n+1))/2;\n        int ct=0;\n        for(int i=0;i<n;i++)\n        {\n            HashMap<Character,Integer> mp=new HashMap<>();\n            //lt.add(s.charAt(i));\n            for(int j=i;j<n;j++)\n            {\n                char ch=s.charAt(j);\n                if(mp.containsKey(ch))\n                mp.put(ch,mp.get(ch)+1);\n                else\n                mp.put(ch,1);\n                if(mp.get(ch)==k)\n                {\n                    ct+=n-j;\n                    break;\n                }\n            }\n        }\n        return ct;\n    }\n}\n```
['Hash Table', 'String', 'Sliding Window', 'Java']