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

Return a map where each key is an Opportunity Type value and each value is the total count of opportunities with that type. Use an aggregate SOQL query to count all opportunities grouped by their Type field.

Examples:

Input: (no parameters - queries from org) Output: {New Customer => 35, Existing Customer - Upgrade => 24, Existing Customer - Renewal => 2} Explanation: The map contains one entry per distinct Type value with its count Input: (varies by org) Output: {} Explanation: Returns empty map if no opportunities exist
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