i am not understanding the return statement in the solve function
**************knapsack 1
Hey in return statement we are using max_element function which finds and return maximum value form an array/container
Here we are returning max value in last row of matrix whose starting location is dp[n] and ending location is dp[n]+W+1
Can you please explain by taking one example and making a matrix of it
What exactly you are not able to understand, how to apply DP on this or knapsack problem overall?
I just want one example explained in the form of matrix and finally what value is returned from that matrix