Welcome to the Python screen.
The question is on your right: Top Five Frequent Error Logs. Read through the requirements first.
Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?
In Meta infrastructure systems, engineers often need to summarize large volumes of Scuba-style server logs. Given a list of log lines, return the top 5 most frequent error messages.
A log line is considered an error message only if it starts with the prefix "ERROR: ". The message is the substring after that prefix. Count identical messages together and return up to 5 messages ordered by descending frequency. If two messages have the same frequency, return them in lexicographically ascending order.
Implement a function that takes a list of strings logs and returns a list of strings.
logs, a list of log linesIgnore all non-error log lines.
def top_five_errors(logs):