Easy solution using Changing Window Size!!
\n\n# Code\n\nclass Solution {\npublic:\n    int solve(int s, int e, string &word, int k) {\n        int ans=0;\n        for(int ws=k; ws<=(e-s+1) && ws/k <=26;
\n\n# Code\n```\nclass Solution {\npublic:\n    int solve(int s, int e, string &word, int k) {\n        int ans=0;\n        for(int ws=k; ws<=(e-s+1) && ws/k <=26; ws+=k){\n            int i=s;\n            unordered_map<char,int>mp;\n            int countGood=0;\n            int res=0;\n            for(int j=s; j<=e; j++){\n                while(j-i+1 > ws){\n                    if(mp[word[i]] == k){\n                        countGood--;\n                    }\n                    mp[word[i]]--;\n                    i++;\n                }\n                mp[word[j]]++;\n                if(mp[word[j]] == k) countGood++;\n\n                if(j-i+1 == ws){\n                    // if(countGood > 0) res+=1;\n                    res+=(countGood*k)/ws;\n                }\n            }\n            ans+=res;\n        }\n        return ans;\n    }\n    int countCompleteSubstrings(string word, int k) {\n        int n = word.length();\n\n        int result = 0;\n        int last = 0;\n\n        for(int i = 1; i <= n; i++) {\n            if(i == n || abs(word[i] - word[i-1]) > 2) { //satisying condition 2\n                result += solve(last, i-1, word, k); //condition 1\n                last = i;\n            }\n        }\n\n        return result;\n    }\n};\n```\n# Please Upvote my solution
['Sliding Window', 'Hash Function', 'C++']