C++ || Easy Solution ||  Faster Than 97.8% Code
class Solution {\n\t\tpublic:\n    int solve(int start,int end,string &word,int k)\n    {\n        int result=0;\n        for(int chars=1;chars<=26 and charsk<=
class Solution {\n\t\tpublic:\n    int solve(int start,int end,string &word,int k)\n    {\n        int result=0;\n        for(int chars=1;chars<=26 and chars*k<=end-start+1 ;chars++)\n        {\n            \n            vector<int> count(26,0);\n            int goodChar=0;\n            int i=start;\n            int windowSize=chars*k;\n            for(int j=start;j<=end;j++)\n            {\n                char c=word[j];\n                count[c-\'a\']++;\n                if(count[c-\'a\']==k)\n                    goodChar++;\n                else if(count[c-\'a\']==k+1)\n                    goodChar--;\n                if(j-i+1>windowSize)\n                {\n                    if(count[word[i]-\'a\']==k)\n                        goodChar--;\n                    else if(count[word[i]-\'a\']==k+1)\n                        goodChar++;\n                    count[word[i]-\'a\']--;\n                    i++;\n                }\n                if(goodChar==chars)\n                     result++;\n            }\n            \n        }\n        return result;\n    }\n    int countCompleteSubstrings(string word, int k) {\n     \n        int result=0;\n        int last=0;\n        int n=word.size();\n        \n        for(int i=1;i<=n;i++)\n        {\n            if(i==n or abs(word[i]-word[i-1])>2)\n            {\n                result+=solve(last,i-1,word,k);\n                last=i;\n            }\n        }\n        return result;\n    }\n\t};
['C']