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!

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 Mar 2026

Contest runs March 3 - 31. Complete challenges to climb the leaderboard!

Points are calculated for challenges completed during the contest period.