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

Query all Prospect accounts and reclassify them as Customer if their AnnualRevenue is greater than or equal to a given threshold. Update the matching accounts in bulk and return the number of records updated. Return 0 if no accounts match the threshold. Return 0 for null or negative threshold values.

Method Signature: public static Integer consolidateAccountTypes(Decimal revenueThreshold)

Examples:

Input: revenueThreshold = 999999999 Output: 0 Explanation: No Prospect accounts have revenue that high, so no updates occur Input: revenueThreshold = null Output: 0 Explanation: Null threshold is invalid, return 0 immediately Input: revenueThreshold = -100 Output: 0 Explanation: Negative threshold is invalid, return 0 immediately Input: revenueThreshold = 0 Output: (count of Prospect accounts with non-null AnnualRevenue) Explanation: All Prospect accounts with a defined revenue qualify at threshold 0
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 August 2026

Contest runs August 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