High-Severity Counts by Search Type
Problem statement
Parallel arrays describe stream logs: searchTypes[i] is the search type and severities[i] is the severity.
For every distinct search type, count logs whose severity is exactly high. Return strings formatted as searchType=count, sorted lexicographically by search type. Include a distinct type even when its count is zero.
Function
highSeverityCountsBySearchType(searchTypes: String[], severities: String[]) → String[]Examples
Example 1
searchTypes = ["transfer","address","transfer"]severities = ["high","low","high"]return = ["address=0","transfer=2"]Both types appear, and only exact high severities count.
Example 2
searchTypes = ["tx","tx"]severities = ["HIGH","low"]return = ["tx=0"]Severity matching is exact and case-sensitive.
Constraints
- The arrays have the same length from
0through100000. - Every search type and severity is a non-empty ASCII string.
- Search types do not contain
=.