In the problem we are given a string where * representing the mines in the game and the numbers representing the sum of number of mines in the adjacent left and the right cell.
for ex:: s =1**2*10
here at position 1 ‘1’ representing the sum of number of mines at position 2
here at position 4 ‘2’ representing the sum of number of mines at position 3 and position 5
here at position 6 ‘1’ representing the sum of number of mines at position 5 and position 7
here at position 7 ‘0’ representing sum of number of mines at position 6
Now in the question at some position there are '?' and u have to replace the question marks with appropriate character such that following rule holds and u have to count number of ways of doing this
eg: ??0?1?
1st way would be : *1001*
2nd way would be: 00001*
so ans would be 2
constraint was
if n is the length of the string
1<=n<=10^5