#K77012. Error Log Analysis
Error Log Analysis
Error Log Analysis
You are given a list of log messages, each containing a timestamp, a log level, and a message. Your task is to filter out the log messages that have the log level [ERROR] and then determine the most common word among these error messages. The words are compared in a case-insensitive manner and punctuation should be ignored. If there are no error messages, output an empty line for the most common word.
For extracting words from the message, use the regular expression \(\verb|\b\w+\b|\) in LaTeX format after converting the message to lowercase.
inputFormat
The first line of input contains an integer \(n\) representing the number of log messages. Each of the next \(n\) lines contains a log message.
outputFormat
If there are any error logs, print each error log on its own line in the order they appear in the input, and then on a new line, print the most common word in these error messages. If there are no error logs, print an empty line.
## sample4
[2023-03-21 14:32:00] [INFO] User logged in
[2023-03-21 14:33:00] [ERROR] File not found
[2023-03-21 14:34:00] [DEBUG] Starting process
[2023-03-21 14:35:00] [ERROR] Unable to open file
[2023-03-21 14:33:00] [ERROR] File not found
[2023-03-21 14:35:00] [ERROR] Unable to open file
file
</p>