Question
A latency log has one line per request: "<path> <latency_ms>" with integer latency. An endpoint is flagged slow when its AVERAGE latency across all its requests is at least the threshold. Return the flagged paths sorted alphabetically. Do the comparison with integers only: an average sum/count >= threshold is exactly the condition sum >= threshold * count, which avoids float rounding entirely. Return an empty list when nothing is flagged or the log is empty.
slow_endpoints(lines: list[str], threshold: int) → list[str][["/a 100","/a 300","/b 100"],200]out["/a"]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.