Code Room
CodingEasycod-g1334
Subject Log processingLevel Entry–Mid~10 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

You are building a tiny report generator for a cron runner's log. Each line is "<timestamp> <LEVEL> <message>", and the message itself may contain several words. Extract the messages of all lines whose level token (the second token) is exactly "ERROR": return just the message texts — timestamp and level stripped — in the order the lines appear. A word like "ERROR" inside some other line's message must not cause that line to be included.

Implement
error_messages(lines: list[str]) → list[str]
Examples
in[["t1 ERROR disk full","t2 INFO rotation done","t3 ERROR net down"]]out["disk full","net down"]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.