Interview Guides
Given a list of log lines logs and a list of target error codes target_codes, write a function that parses each line and returns a mapping from timestamp to error-code counts. Each valid log line has the format TIMESTAMP|LEVEL|CODE|MESSAGE. Only count lines whose CODE is in target_codes. Ignore malformed lines.
1 <= len(logs) <= 10^51 <= len(target_codes) <= 10^31 to 10^4|