Please convert this recusive solution to top down dp in subset sum problem
You can obeserve here that the dp states here are n,sum. So make a 2d dp table of boolean type.
The size of the dp/memo table must be in accordance with the constraints.
in this question i face probelm in returning value to dp should i initilise dp to false please check this code and what should i return in the end .https://ide.codingblocks.com/s/249994
Check now. Also you must increase the size of dp array according to the constraints.
https://ide.codingblocks.com/s/250544 i try for bottom up dp also it gives one run error and rest two test cases get passed.what is the problem in this code please check
Check your code from line 30 to 33 , j-a[i] may have a negative value…causing runtime error. Cross check your code that you are not accessing any index which is out of bounds.