You're handed a list of record dicts shaped like {"customer_id": str, "amount": number} — but the data is dirty. Sum the amount per customer and return a list of (customer_id, total) tuples sorted by total descending, ties broken by customer_id ascending.
Skip (don't crash on) any record where: - customer_id is missing or empty, - amount is missing / None, not a number (a float NaN counts as not a number), or negative.
Note: a Python bool must not be treated as a number here (True is not revenue). Empty input returns [].
What the tests check
8 on Run · 9 on Submit01empty input returns empty list
02sums multiple rows per customer
03skips None amount
04skips negative amount
05skips missing or empty customer_id
06skips non-numeric amount
07bool is not treated as a number
08a NaN amount is skipped, not added
Submit runs these and one more check you don’t see, so code written for the visible tests alone can still miss.