4014. Minimum Total Price After Applying Discounts
You are given two integer arrays
pricesanddiscounts.The value
prices[i]represents the price of thei^thitem, anddiscounts[j]represents a discount percentage.You may apply discounts subject to the following rules:
- Each discount can be applied to at most one item.
- Each item can receive at most one discount.
- An item may also receive no discount.
If a discount of
dpercent is applied to an item with pricep, its final price becomes(p * (100 - d)) / 100. The final price is not rounded.Return the minimum possible sum of final prices after assigning discounts optimally. Answers within
10^-5of the actual answer will be accepted.
1 |
|