C++ || HashMap || Sliding Window
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\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```\nclass Solution {\n\nprivate:\n    bool isEqualK(unordered_map<char, int>& mp, int k) {\n        for(auto ele : mp) {\n            if(ele.second != 0 && ele.second != k) return false;\n        }\n\n        return true;\n    }\n\n    bool adjjacentDiff(string& word, int i, int j) {\n        for(int ind = i+1; ind <= j; ind++) {\n            if(abs(word[ind] - word[ind-1]) > 2) return false;\n        }\n\n        return true;\n    }\n\npublic:\n    int countCompleteSubstrings(string word, int k) {\n        int n = word.size();\n        \n        // get number of distinct chars\n\n        unordered_map<char, int> mp;\n\n        for(int i = 0; i < n; i++) {\n            mp[word[i]]++;\n        }\n\n        int uniqChars = mp.size();\n\n        // window size be multiple of k\n        // 1k, 2k, 3k, \n        // just slide the window i++ j++ simple\n        // this do for all sizes (26 different sizes atmost)\n\n        int count = 0;\n\n        for(int uniq = 1; uniq <= uniqChars; uniq++) {\n            int windowLen = uniq*k;\n\n            if(windowLen > word.size()) break;\n\n            // calc initial window freq\n            unordered_map<char, int> mp;\n\n            for(int i = 0; i < windowLen; i++) {\n                mp[word[i]]++;\n            }\n\n            // check if valid or not\n            if(isEqualK(mp, k) && adjjacentDiff(word, 0, windowLen-1)){\n                count++;\n            }\n\n            // now shift the sliding window\n            int start = 0;\n\n            while(start + windowLen < n) {\n                mp[word[start]]--;\n                mp[word[start+windowLen]]++;\n                start++;\n\n\n                if(isEqualK(mp, k) && adjjacentDiff(word, start, start + windowLen-1)) {\n                    count++;\n                }\n\n            }\n        }\n\n        return count;\n    }\n};\n```
['Hash Table', 'Sliding Window', 'C++']