It gives segment error…
though i have got the ans by linear dp but i dont thing this is the correct approach…
Please answer both my question…
It gives segment error…
though i have got the ans by linear dp but i dont thing this is the correct approach…
Please answer both my question…
hello @Ram_Vilash_Kumar
.
cb compiler has some issue thats why it is giving error for array of size 10^7.
u can declare array of size upto 10^8 if its datatype is bool.
1dp approach is also correct.
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.