← 返回 amazon 的题目列表Rewards Rank Calculation
类型:online_judge
Amazon Shopping is running a reward collection event for its customers. There is an initial initialRewards array that contains points for each customer.
A final tournament will take place where the winner will be awarded 3 points, the runner-up will be awarded 2 points, and the customer in third place will get 1 point. All other customers earn no additional points.
Given an integer array initialRewards, calculate the total points for each customer after the tournament.
Input
initialRewards: List of integers representing initial points of customers.
Output
List of integers representing total points of each customer.
Constraints
Number of customers not less than 3.
Example
Input:
initialRewards = [8, 3, 4]
Output:
[11, 5, 4]
Example
Input
3
8 3 4