Loading...
Loading...
Loading...
A shop owner wants to know how many orders were larger than the average order. Count the orders whose amount is strictly greater than the average of all orders.
Example
Input
4 120 80 300 100
Output
1
The average is 150, and only 300 is above it.
Try the problem first. Open one hint at a time.
Compute the average once before the loop; do not recompute it for each order.
Compare amount * n with the total instead of dividing, so no decimals appear.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor