A string consisits of the character a,A,b,B,c,C.The below conditions makes the string special:-
1.An empty string is a special string.
2.Strings like ‘A’+specialstring+‘a’ are special string where the first and last letters are of different case(first one is upper and the last one is lower) and the rest of the string is special.
3.Concatenation of two strings is a special string.If str1 and str2 are special string then str1+str2 is special.
Now,the problem is someone disrupted the string by putting ‘?’ in some characters.Now we have to figure out the no of special strings that can be make using the disrupted strings.
Test case:-
Input:-
??aB??
Output:-
3
Explaination:-
AAaBba
BAaBbb
CAaBbc
Please help me out How to solve this problem?