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

Update the Rating on each Account in the supplied list of Ids based on the NumberOfEmployees field. Use Hot when employees is greater than 1000, Warm when employees is between 100 and 1000 inclusive, and Cold when employees is less than 100. Skip accounts whose NumberOfEmployees is null. Return the number of accounts that were updated. Return 0 for null or empty input.

Examples:

Input: accountIds = [001..., 001..., 001...] Output: 3 Explanation: All three accounts have an employee count and receive a rating Input: accountIds = [] Output: 0 Explanation: Empty input results in zero updates Input: accountIds = null Output: 0 Explanation: Null input results in zero updates
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

🏆 All Time Leaderboard

Contest runs January 1, 1970 - December 31, 9999. Complete challenges to climb the leaderboard!

Points are calculated for challenges completed during the contest period.

Wally can't hear you

Please sign in to access the AI Assistant

Sign In