This question runs in a pre-configured Salesforce environment - no personal connection required.
Query all Account records and return a Map where the key is the BillingCountry and the value is the Name of the Account with the highest AnnualRevenue in that country. Only include countries that have at least one Account with a non-null AnnualRevenue.
Examples:
Input: No parameters
Output: {'USA' => 'TechFlow Solutions', 'Germany' => 'Deutsche Manufacturing', 'Japan' => 'Nippon Electronics'}
Explanation: TechFlow Solutions has the highest revenue in USA, Deutsche Manufacturing has the highest in Germany, and Nippon Electronics has the highest in Japan
Input: No parameters
Output: {'USA' => 'Cloud Code Academy', 'Australia' => 'Aussie Commerce'}
Explanation: If only USA and Australia have accounts with non-null revenue, only these countries appear in the result
Apex Code Editor
Welcome to Lightning Challenge!
How It Works
- • Write your solution in the code editor
- • This challenge runs without connecting your own org
- • Submit to check if your solution passes
- • Use hints if you get stuck
Contest Alert
🏆 #CodeEveryDay November 2026 (Nov 16–30)Sponsored by FLXBL
Contest runs November 16 - 30. Complete challenges to climb the leaderboard!
Prizes 1 & 2: Salesforce certification exam voucher — won by random drawing, where every point is a ticket. see all prizes
Only the 15 daily challenges shown during this contest count toward points. Earlier dailies don't carry over.