n(n+1)/2 + 1 ( 1 for epsilon)

=> (10 * 11)/2 + 1

=> 56

option 3.

=> (10 * 11)/2 + 1

=> 56

option 3.

The Gateway to Computer Science Excellence

0 votes

+1 vote

**a d e f b g h n m p ; N=10 **(all distinct)

Substring of length $0\rightarrow\;$1(i.e. null string)

Substrings of length $1\rightarrow\;N$

Substrings of length $2\rightarrow\;N-1$

Substrings of length $3\rightarrow\;N-2$

•

•

Substrings of length $N-1\rightarrow\;2$

Substrings of length $N\rightarrow\;1$

Total no. of substrings $=1+N+(N-1)+(N-2)+\cdots+2+1$

$=1+\frac{N(N+1)}{2}$

Here N=10, so total substrings = 1+55 = 56.

52,375 questions

60,615 answers

202,052 comments

95,433 users