A trivial observation is that if the value of (p-s) for any two sequences is the same (where p and s denote the number of pluses and minuses respectively), they have the same final position. I’ll refer to this value as the balance.

Let’s find the balance for the original sequence and the interpreted sequence (ignoring the *?* marks). Suppose the balance for the original sequence is 5, and the interpreted sequence is 3, and you have 6 ‘?’ marks in the interpreted sequence.

You now know that you need to replace the ‘?’ marks with a sequence whose balance, when added to 3, makes the entire balance 5. This is obviously 2.

We need to place pluses and minuses such that the number of pluses (let it be p) is 2 greater than number of minuses (let it be m). You also know that p+m = q, where q is the number of question marks (6 in this case).

Your two equations are p+m=q and p-m=2. Solve those, and you get p=4 and m=2.

You now need to count number of ways to arrange these pluses and minuses in the place of question marks. This count is q \choose p.