Wildcard prob---all test case not passing

Hey, you have not added a particular condition try submitting it after adding that condition.I have mentioned the condition in comments.


Also,try to solve it using dp.As even if your code is correct , you will get tle error.

You read about dp implemetation here: