Zeta | SDE-I | Interview
Question · Posted Nov 2020
You are given a bag of size W kg and you are provided costs of different weights of oranges in array cost[] where cost[i] is basically the cost of i kg of oranges. Here, cost[i] = -1 means that i kg packet of orange is unavailable. Find the minimum total cost to buy exactly W kg oranges. A standard knapsack problem link to the question and solution: here
The full answer & interview discussion are available to premium members.
Log in Create a free account