Help finding sum of the number of distinct characters in all the distinct substrings of string S.

Revision en1, by deepak1527, 2019-05-17 17:53:39

How to solve the following problem. Find the sum of the number of distinct characters in all the distinct substrings of S. 1<=|S|<=100000. S="aabb"
Set of distinct sub-strings of "aabb" = {a,b,aa,ab,bb,aab,abb,aabb} sum = 1 + 1 + 1 + 2 + 1 + 2 + 2 + 2 = 12.

Thanks!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English deepak1527 2019-05-17 17:53:39 453 Initial revision (published)