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!
Create an Account
Sign up to track your progress, earn points, and compete with others. Your solutions will be saved automatically.
Create accountHow It Works
- • Write your solution in the code editor
- • Connect your Salesforce org to test
- • Submit to check if your solution passes
- • Use hints if you get stuck
Contest Alert
🏆 #CodeEveryDay Feb 2026
Contest runs February 1 - 28. Complete challenges to climb the leaderboard!
Points are calculated for challenges completed during the contest period.