Easy solution
Code\njava []\nclass Solution {\n    public int numberOfSubstrings(String s, int k) {\n        int n = s.length();\n        HashMap<Character, Integer> map = ne
# Code\n```java []\nclass Solution {\n    public int numberOfSubstrings(String s, int k) {\n        int n = s.length();\n        HashMap<Character, Integer> map = new HashMap<>();\n\n        int i = 0, j = 0;\n        int ct = 0;\n        while (i < n) {\n            char ch = s.charAt(i);\n            map.put(ch, map.getOrDefault(ch, 0) + 1);\n\n            while (map.containsKey(ch) && map.get(ch) >= k) {\n                if (map.get(ch) >= k) {\n                    ct += n - i;\n                }\n                map.put(s.charAt(j), map.get(s.charAt(j)) - 1);\n                if (map.get(s.charAt(j)) == 0) {\n                    map.remove(s.charAt(j));\n                }\n                j++;\n            }\n            i++;\n        }\n        return ct;\n    }\n}\n```
['Hash Table', 'String', 'Sliding Window', 'Java']