← 返回 amazon 的题目列表Count of Top Ranked Customers
类型:online_judge
Given a list where each element represents a customer's score. Three customers are participating in a lottery, the first place will have n points added to their score (where n is the number of customers), the second place will have n-1 points, and so on. Calculate the number of customers with the highest score after adding extra points. Multiple customers can share the top rank.
Example:
Input: [1, 3, 4]
Output: 2
Explanation:
The first customer gets 3 extra points, total score becomes 4.
The second customer gets 2 extra points, total score becomes 5.
The third customer gets 0 extra points, total score becomes 4. Thus, the number of top-ranked customers is 2 (second and third customers).
Example
Input
[1, 3, 4]