An interesting problem on subanagrams.

Revision en3, by illmondo, 2018-04-20 14:49:51

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^6. Length of every string <= 50. q<= 10^4.

Tags #problem, #strings, #data structure, #advance data structures

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en6 English illmondo 2018-04-20 15:43:44 30
en5 English illmondo 2018-04-20 14:52:21 3 Tiny change: 'ers only) in count(c, ' -> 'ers only) count(c, '
en4 English illmondo 2018-04-20 14:51:36 2 Tiny change: 'string <= 50. q<= 10^' -> 'string <= 30. q<= 10^'
en3 English illmondo 2018-04-20 14:49:51 4
en2 English illmondo 2018-04-20 14:35:24 2 Tiny change: 'I created.\n You are' -> 'I created. \n You are'
en1 English illmondo 2018-04-20 14:34:38 462 Initial revision (published)