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 July 2026
Contest runs July 1 - 31. Complete challenges to climb the leaderboard!
Only the 31 daily challenges shown during this contest count toward points. Earlier dailies don't carry over.