【代码随想录训练营】【Day42】第九章|动态规划|01背包问题(二维)|01背包问题(一维|滚动数组)|416.分割等和子集
01背包—理论基础(二维)详细的题解可以查阅:《代码随想录》—01背包理论基础Java解法(动态规划):classQuestion{publicintsolve(intbagWeight,int[]weights,int[]values){int[][]dp=newint[weights.length][bagWeight+1];for(intj=weights[0];j=weights[i];j