Problem 2949 · Hard

Count Beautiful Substrings II

A substring is beautiful when its vowels equal its consonants and their product is divisible by k. Prefix balances turn each check into a lookup.

Open the interactive visualisation