Hello, coders. Here is an interesting problem I created.
You are given a list of strings with total size N. We define subanagram of a string s, such string s1 that for every character c (a-z letters only) in count(c, s1) <= count(c, s) . You are given q queries. Each consists of a single string s. You have to output the number of subanagrams for every s. Constraints: n<= 10^5. Length of every string <= 50. q<= 10^4.