You are given:
prices
of length
n
, where
prices[i]
is the price of the
i-th
item.
discountPercent
(0 to 100).
A promotion applies only to one item: the most expensive item receives discountPercent percent off. If there are multiple items tied for the maximum price, discount any one of them (the result is the same).
The discounted amount may be fractional. The final amount to pay is:
Return the final amount to pay as an integer.
prices
: array of non-negative numbers (integers or decimals)
discountPercent
: integer in
[0, 100]
1 <= n <= 2 * 10^5
0 <= prices[i] <= 10^9
prices = [100, 50, 25]
,
discountPercent = 20
155