[LeetCode] Count Complete Substrings

1 · · Dec. 3, 2023, 2:39 p.m.
Summary
2953. Count Complete Substrings You are given a string word and an integer k. A substring s of word is complete if: Each character in s occurs exactly k times. The difference between two adjacent characters is at most 2. That is, for any two adjacent characters c1 and c2 in s, the absolute difference in their positions in the alphabet is at most 2. Return the number of complete substrings of word. A substring is a non-empty contiguous sequence of characters in a string. ...