I was able to solve this problem using 1D Dp as there was infinite supply for packet of oranges whereas Sanket Sir in hint suggests that it will be solved using 2D dp.
I think the hint given for this question is wrong
I was not able to understand 2d dp . In that what is the meaning of the cell of 2d dp of(n+1)*(w+1)?
What does each cell imply in the dp matrix?