You are given two integer arrays price and tastiness, both of length n, where price[i] and tastiness[i] represent the price and tastiness of the maxAmount and maxCoupons.
You want to maximize the total tastiness of the fruits you purchase subject to the following rules:
You can purchase each fruit at most once.
You have a total budget of at most maxAmount.
You can use at most maxCoupons discount coupons. Each coupon can be applied to at most one fruit, reducing its price to price[i]
Return the maximum total tastiness you can obtain.
Constraints:
n == price.length == tastiness.length
n
price[i], tastiness[i], maxAmount
maxCoupons
You are given two integer arrays price and tastiness, both of length n, where price[i] and tastiness[i] represent the price and tastiness of the maxAmount and maxCoupons.
You want to maximize the total tastiness of the fruits you purchase subject to the following rules:
You can purchase each fruit at most once.
You have a total budget of at most maxAmount.
You can use at most maxCoupons discount coupons. Each coupon can be applied to at most one fruit, reducing its price to price[i]
Return the maximum total tastiness you can obtain.
Constraints:
n == price.length == tastiness.length
n
price[i], tastiness[i], maxAmount
maxCoupons