General Electric || OA 2021

You are given a String C. You have to perform following operation on it :
1.Pick any two non-overlapping substrings that are exactly same and delete one of the substrings
2.Repeat the operation 1 until you are unable to do so
We have to find out the number of possible different substrings after performing the operations.
Constraints :slight_smile:

1<T<=100
1<|S|<=10^4

Test case Input:
1
abcc
Sample output :slight_smile:
2

for any such string the remaining characters would be the number of unique characters in string

sorry bro the question was incomplete .

We have to find out the number of the different substrings possible after performing the operations.

THIS CAN BE SOLVED WITH RECURSIVE DP