Java Clean Solution | Weekly Contest
Code\njava []\nclass Solution {\n    private boolean helper(int[] freq, int k){\n        for(int f:freq){\n            if(f>=k){\n                return true;\n
# Code\n```java []\nclass Solution {\n    private boolean helper(int[] freq, int k){\n        for(int f:freq){\n            if(f>=k){\n                return true;\n            }\n        }\n        return false;\n    }\n    \n    public int numberOfSubstrings(String s, int k) {\n        int n = s.length();\n        \n        int res=0;\n        for(int i=0; i<n; i++){\n            int[] freq = new int[26];\n            for(int j=i; j<n; j++){\n                char ch = s.charAt(j);\n                freq[ch-\'a\']++;\n                \n                if(helper(freq, k)){\n                    res++;\n                }\n            }\n        }\n        return res;\n    }\n}\n```
['Math', 'String', 'String Matching', 'Java']