Top driver in each city
A ride-hailing service rewards the best driver in each city. For each city, find the driver with the highest total fare across completed trips. Ignore trips with no assigned driver. Return city, driver_id and the revenue total, ordered by city, then driver id.
Voorbeeld van verwachte uitvoer
Zo ziet een correct antwoord eruit — het aantal rijen is op zichzelf staand en hoeft niet overeen te komen met de schematabellen.
| city | total | driver_id |
|---|---|---|
| Kazan | 400 | 3 |
| Moscow | 800 | 1 |
Log in om je inzendingsgeschiedenis te zien
InloggenLog in om de AI-mentor te gebruiken
Inloggen