Dynamic-Programming-Questions-by-Aditya-Verma icon indicating copy to clipboard operation
Dynamic-Programming-Questions-by-Aditya-Verma copied to clipboard

Aditya Verma (Youtube) DP Playlist Codes/Solutions.

Results 4 Dynamic-Programming-Questions-by-Aditya-Verma issues
Sort by recently updated
recently updated
newest added

[https://practice.geeksforgeeks.org/problems/0-1-knapsack-problem0945/1#](url) ``` int knapSack(int W, int wt[], int val[], int n) { int t[n+1][w+1]; memset(t,-1,sizeof(t)); if(n==0 || w==0){return 0;} if(t[n][w]!=-1){ return t[n][w];} else{ if(w>=wt[n-1]) t[n][w]=max(val[n-1]+knapSack(w-wt[n-1],wt,val,n-1),knapSack(w,wt,val,n-1)); else t[n][w]=knapSack(w,wt,val,n-1); return t[n][w]; }}};...

for : count_of_subsets_with_given_sum.cpp (https://github.com/shubhamchemate003/Dynamic-Programming-Questions-by-Aditya-Verma/blob/main/count_of_subsets_with_given_sum.cpp) is failing for ``` n=10 sum=31 arr[] = 9 7 0 3 9 8 6 5 7 6 ``` Working Code : ``` for(int i=0;i

Hey, this repo you have made has helped me a lot, because I get the logic but when it comes to coding it, it sometimes feels difficult, so thank you...

if the given array is -- [0,o,1,I,2,3] (o,I for visible change) the diff = 1 result = 1 - {0,1,2}, {o,I,3} 2 - {o,1,2}, {0,I,3} 3 - {0,o,1,2}, {I,3} 4...