[LeetCode] Count Beautiful Substrings I

1 · · Nov. 26, 2023, 4:34 a.m.
Summary
2947. Count Beautiful Substrings I You are given a string s and a positive integer k. Let vowels and consonants be the number of vowels and consonants in a string. A string is beautiful if: vowels == consonants. (vowels * consonants) % k == 0, in other terms the multiplication of vowels and consonants is divisible by k. Return the number of non-empty beautiful substrings in the given string s. A substring is a contiguous sequence of characters in a string. Vowel letters in English are 'a', 'e...