You have a string S, but you like only special strings. So, you have to calculate the total number of special substrings in S.
A string T, of length L, is called special string, if either of the following property holds:
Count the total number of special substrings in S.
Input constraints:
S="aba"
Then there are 4 special substrings: {"a", "b", "a", "aba"}