This question runs in a pre-configured Salesforce environment - no personal connection required.

Query all accounts and find the minimum annual revenue for each country. Return a Map where the key is the BillingCountry and the value is the minimum AnnualRevenue for accounts in that country. Only include countries that have at least one account with non-null AnnualRevenue.

Use SOQL aggregation with the MIN() function and GROUP BY clause to find the minimum revenue per country. Filter out accounts where either BillingCountry or AnnualRevenue is null.

Examples:

Input: (no parameters - queries all accounts) Output: {'USA' => 250000, 'Germany' => 12000000, 'Japan' => 8900000, ...} Explanation: Returns Map with each country as key and minimum annual revenue as value Input: (no parameters - queries all accounts) Output: Map with multiple countries and their minimum revenue values Explanation: Only countries with at least one non-null AnnualRevenue are included
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.

Wally can't hear you

Please sign in to access the AI Assistant

Sign In