This question runs in a pre-configured Salesforce environment - no personal connection required.
Given an industry name, update the Description field of all accounts in that industry. Set each account Description to the format: "AccountName - Rating" (use "Unrated" if the Rating field is null). Return the number of accounts updated. Return 0 for null or blank industry input.
public static Integer updateAccountDescriptions(String industry)
Examples:
Input: industry = 'Technology'
Output: 3
Explanation: Three Technology accounts updated with new descriptions
Input: industry = 'NonExistentIndustry'
Output: 0
Explanation: No accounts found for this industry
Input: industry = null
Output: 0
Input: industry = ''
Output: 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 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.