##### Count the number of possible sub-strings from a given string of length n.

Total number of sub strings present in "GATE" is

A)7 B) 10 C) 11 D) 8

Answer-11

explanation:

length = 1 ( null/epsilon)

1 length = 4 (G,A,T,E)

2 length=3 ( GA, AT , TE)

My doubt is->Here why are we not considering GT,GE and AE while counting strings of length 2?

3 length= 2 ( GAT, ATE)

My doubt is->Here why are we not considering GET and AGE while counting strings of length 3?

4 length = 1( GATE)

Ohk.. Listen,

Substrings are

consecutivesubsequences.Reference : https://math.stackexchange.com/questions/1237097/difference-subsequences...

Thx Mate. Appreciated !!

direct formula {n(n+1)/2}+1