HackwithInfy round1 problem(7 May 2021)
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 11’ representing the sum of number of mines at position 2
here at position 42’ representing the sum of number of mines at position 3 and position 5
here at position 61’ representing the sum of number of mines at position 5 and position 7
here at position 70’ 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
Comments (0)