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

Write a method that uses SOQL to find all Industry and BillingCountry combinations where more than one Account exists. Return a List<String> where each entry is formatted as 'Industry - Country (count)' and sorted alphabetically by the formatted string. Return an empty list if no combinations have more than one account.

Examples:

Input: Database contains 3 accounts with Industry='Technology' and BillingCountry='USA' Output: ['Technology - USA (3)'] Explanation: The combination has 3 accounts, so it is included Input: Database contains 2 accounts with Industry='Finance' and BillingCountry='UK', and 2 accounts with Industry='Healthcare' and BillingCountry='Canada' Output: ['Finance - UK (2)', 'Healthcare - Canada (2)'] Explanation: Both combinations have more than one account, sorted alphabetically Input: Database contains 1 account with Industry='Manufacturing' and BillingCountry='Germany' Output: [] Explanation: The combination has only 1 account, so it is excluded Input: Database contains 2 accounts with Industry='Technology' and BillingCountry='Japan', and 1 account with Industry='Technology' and BillingCountry='USA' Output: ['Technology - Japan (2)'] Explanation: Only the Japan combination has more than one account Input: No accounts in database Output: [] Explanation: Empty database returns empty list
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 October 2026 (Oct 16–31)Sponsored by FLXBL

Contest runs October 16 - 31. 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 16 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