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!
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.