← 返回 uber 的题目列表Find Discounted Prices
类型:online_judge
Given an array of prices, for each element prices[i], find the first element to the right which is smaller than it and treat it as a discount. If no such element exists, maintain the original price. Output the final expenditure.
Example
Input
8 4 6 2 3
Output
4 2 4 2 3