Cses DP question removing Digits

it shows runtime error in one test case,
I’m not able to understand why it is ??

Hey @ankit_verma
Please share the link to the question :slight_smile:

https://cses.fi/problemset/task/1637
sorry this is right link for that question

Hey @ankit_verma
Declare your dp array globally

vi dp(1000005,INT_MAX);

Sometimes it gives error when we try to make an array of size >=10^6 locally because max space we can allocate inside any function is close to 10^6

1 Like

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.