Adecco One emits application logs in a pipe-delimited format. Given an array of log lines, parse each line, keep only ERROR events from selected services within a half-open time interval, and aggregate the number of occurrences for each error code.
Each valid log line has this format:
timestamp|service|level|error_code|message
The timestamp is an integer, and the message may contain additional pipe characters. Return a dictionary mapping each matching error code to its count. If no lines match, return an empty dictionary.
Implement aggregate_error_counts(logs, allowed_services, start_time, end_time).
logs is a list of strings.allowed_services is a list of service names.start_time is inclusive and end_time is exclusive.ERROR.def aggregate_error_counts(logs, allowed_services, start_time, end_time):