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) 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 of s in the given list of strings. Constraints: n<= 10^6. Length of every string <= 30. q<= 10^4.