Hidden Test cases are not passing

I implemented the above problem and it is running fine on Sample Test Cases. Please look into my code and tell me what is actually wrong
This is the code: https://ide.codingblocks.com/s/245225

@hargovind
line no 47 should be cout << minCostDP(cost, w, w) << endl;
you have to buy Wkg of oranges and number of elements in array is also w.

1 Like

@shrm.abhishek.kmr thanks a lot. So basically it has nothing to do with number of friends, we just have to use weight and minimize the cost. Thank you

@hargovind
yes exactly.

1 Like