Doubt in question statement

Heyy it is mentioned there that, there is an infinite supply of oranges. Does that mean, we can pick one item multiple times?

@Aparna yes you can take one value multiple time.

1 Like

heyy please check my code. I want to do this with top down dp. Please suggest the required changes

@Aparna hi,in line 26 do w-a[n-1] in function argument.

But a[n-1] represents value not weight weight is represented by ith value as mentioned in the question

@Aparna hey,actually weight array me value represent krrhe hai ,to if we consider current element then remaining weight will be w-element weight which is in array thats why we are doing that.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.