Count Leads by Status
Not Started

Implement the method, countLeadsByStatus that takes a list of Lead records as input and returns a map where the keys are the Lead status values and the values are the counts of Leads for each status. The Lead status values can include "New", "Working", "Closed - Won", "Closed - Lost", and any other custom status.

Example 1

Input: A list of Lead records with the following statuses: "New", "Working", "New", "Closed - Won", "Closed - Lost", "Working"

Output: { "New" => 2, "Working" => 2, "Closed - Won" => 1, "Closed - Lost" => 1 }

Explanation: There are 2 Leads with the status "New", 2 with "Working", 1 with "Closed - Won", and 1 with "Closed - Lost"


Example 2

Input: A list of Lead records with the following statuses: "New", "New", "New"

Output: { "New" => 3 }

Explanation: All 3 Leads have the status "New".


Example 3

Input: A list of Lead records with the following statuses: "Closed - Won", "Closed - Won", "Closed - Won"

Output: { "Closed - Won" => 3 }

Explanation: All 3 Leads have the status "Closed - Won".


Constraints:

The input list can contain up to 1000 Lead records.
Each Lead will have a non-null status.