in this question , how can we create 2d dp array as the size of dp array is 5000*10^7 which is not possible in normal array , and hashmap s giving tle.
please help
The Subset Sum To Target doubt
we need to create a dp table of size n*n, and solve using bottom up manner
i have checked the test cases , sum is less than 100000.
but we can also solve in resursive manner , here is my code i dont know why it is giving error https://ide.codingblocks.com/s/104801
always prefer bottom up dp then recursive dp, because it takes too much memory
make a dp table of size sum*n and see whether dp[a[i]-j] exists or not if yes then make it true,
return dp[n][sum]
THANKS APAAR , CAN I GET YOUR WHATAPP NUMBER , i need guidance from you
8279798102 …or yyou can message on fb
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.