Sir getting TLE inspite of using 2D DP table
Subset sum 2D DP
Link to the code:
Once dimension for sum value and another for index at which we get that sum. How 1D DP?
@pangatt4 through 1 dp problem we will keep the data in the way whivh will tell us if that particular sum value can lead us to the target value or not.
check your chat i have send you the explanation here.
Can you please share the explanation for how the question can be solved using a 1D array.
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.