It's showing run time error for one test case rest is passing.Kindly check my code once

hello @gaganpreetsachdev1
declare ur array as global and then try.

if still it fails then try to make ur code memory efficient

Still run error. What to do?

@gaganpreetsachdev1
reconstruct the given pattern by removing consecutive *
and then apply dp.

refer this->

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.