Course exam: the log report

Your task Ticket PY-550, priority high, for the platform lead. Write a function summarize(lines) for log lines like 2026-06-01 10:00:01 ERROR db: timeout. Skip lines that don't fit that format. Give back a dict with "levels" (a dict from each level to how many lines had it), "top_source" (the source with the most ERROR lines, A to Z first if tied, or None with no errors) and "first_error" (the time of the first ERROR line, or None). In the code box, write the function, then press Run my code.

Getting the editor ready