You are given a string word and an integer k.
A substring of word is considered complete if it satisfies both of the following conditions:
Every distinct character present in the substring appears exactly k times within that substring.
The absolute difference between the alphabet positions of any two adjacent characters in the substring is at most
Return the total number of complete substrings of word.
Constraints:
word.length
word consists only of lowercase English letters.
k word.length
You are given a string word and an integer k.
A substring of word is considered complete if it satisfies both of the following conditions:
Every distinct character present in the substring appears exactly k times within that substring.
The absolute difference between the alphabet positions of any two adjacent characters in the substring is at most
Return the total number of complete substrings of word.
Constraints:
word.length
word consists only of lowercase English letters.
k word.length