Each log line looks like 2026-11-02T10:00:00Z LEVEL message... where LEVEL is one of DEBUG, INFO,
WARN, ERROR, FATAL. Count lines per level. Lines that don't have a valid ISO-looking timestamp
(YYYY-MM-DDTHH:MM:SSZ) and a known level as the first two fields are counted under "malformed".
Return only levels that occurred (plus "malformed" if any).
Implement level_counts. Input: lines: list[str]. Returns: dict[str, int].
def level_counts(lines: list[str]) -> dict[str, int]:
return {}
Run executes the public tests. Submit grades against public and hidden tests.
Each log line looks like 2026-11-02T10:00:00Z LEVEL message... where LEVEL is one of DEBUG, INFO,
WARN, ERROR, FATAL. Count lines per level. Lines that don't have a valid ISO-looking timestamp
(YYYY-MM-DDTHH:MM:SSZ) and a known level as the first two fields are counted under "malformed".
Return only levels that occurred (plus "malformed" if any).
Implement level_counts. Input: lines: list[str]. Returns: dict[str, int].
def level_counts(lines: list[str]) -> dict[str, int]:
return {}
Run executes the public tests. Submit grades against public and hidden tests.