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

Given a minimum contact count, return a list of Account names that have at least that many Contacts associated with them. The results should be ordered by contact count descending so that accounts with the most contacts appear first. If minCount is 0 or negative, return all Account names that have at least one contact, ordered by contact count descending.

Examples:

Input: minCount = 3 Output: ['Acme Corp', 'Global Industries'] Explanation: Only accounts with 3 or more contacts are returned, ordered by contact count descending Input: minCount = 1 Output: ['Acme Corp', 'Global Industries', 'Local Biz'] Explanation: All accounts with at least 1 contact Input: minCount = 100 Output: [] Explanation: No accounts have 100 or more contacts Input: minCount = 0 Output: ['Acme Corp', 'Global Industries', 'Local Biz'] Explanation: minCount of 0 means return all accounts with at least 1 contact
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 account

How 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 June 2026

Contest runs June 1 - 30. Complete challenges to climb the leaderboard!

Only the 30 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