Wildcard Pattern Matching Problem

4 test cases passed but 2 test cases are giving run time error.
code link: https://ide.codingblocks.com/s/241489
Please help.

look at the size in the constraint in question

@Ankit003 I declared size of dp as 1000*1000 but if i change it a little bit then the 4 test cases also give WA.
Can you please correct my code .I have been debugging the code for hours.

you should create a vector of dp and also check the condition that consecutive * separately.

@Ankit003 i checked for the condition of consecutive * .
Could you please correct my code because i have corrected my code many times and it gives run time error for last 2 cases.

What are u doing in allstars function?