How many substrings?

substring

#1

how find the number of diffrent substrings in string S.


#2

If this question is related to the problem included in Sep 13 challenge, then please hold on till the contest gets over. You will be answered in a very better manner. Don’t worry. :slight_smile:


#3

if the string length is n… then total substrings are 2^n .


#4

And how come, the tile of this question is “permutation and combination”?


#5

build the suffix array and compute the lcp(longest common prefix).


#6

for clarity: if S=aa than it’s got 3 different substrings - empty, ‘a’ and ‘aa’?


#7

he has asked for different substrings


#8

updated :smiley: