Doubt regarding string problem

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?

u need to put checks
first if empty return it true
next u have start from the first char and see if the last char satisfies the condition and recursively solve for the rest of the string
to check for the third u have to solve the string in two parts of diff sizes
now these are the direct approaches
next comes for ‘?’
first the length should be even
next u will have to send it in each of the three functions again
if a question mark is reached both at end and first u replace them with the same character and try to solve for the second function, otherwise which ever is not a question mark u replace it with that
if u reach a solvable state return true
if not then u try for the already given characters and use divide and conquer about the given characters

also, provide the link to the question if u can

Actually,i dont have the link.It was being asked in hackwithinfy round2