Your question is Aggregate Error Codes from Logs. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an array of log lines logs and an array of target error codes target_codes, return a dictionary mapping each target error code to the number of times it appears in the logs. A valid error code appears in the form ERROR_CODE=<code> within a log line. Ignore malformed lines and codes not present in target_codes.
ERROR_CODE=<code> and ends at the next space or end of linedef aggregate_error_codes(logs, target_codes):