#K69052. Event Log Counter
Event Log Counter
Event Log Counter
You are given an integer n representing the number of event log entries, followed by n lines describing each event log.
Each event log is a string containing several fields separated by spaces. The third field in each log represents the event type, which can be one of the three types: 1, 2, or 3.
Your task is to count the number of occurrences of each event type and output the counts as three space-separated integers corresponding to event types 1, 2, and 3 respectively.
The event type extraction is defined as follows:
Let the ith event log be a string log_i. The event type is the result after splitting the string on whitespace and taking the third element, i.e.,
\[ \text{event_type} = \text{int}(\text{log}_i.split()[2]) \]inputFormat
The input is read from standard input (stdin) and is formatted as follows:
Line 1: A single integer n, the number of event logs. Next n Lines: Each line is an event log entry.
outputFormat
Output to standard output (stdout) three space-separated integers representing the counts of events of type 1, type 2, and type 3, in that order.
## sample5
101 2023-05-01T12:30:45 1 User123 logged in
102 2023-05-01T12:35:00 2 User123 accessed file XYZ
103 2023-05-01T12:45:00 3 Error code 500: Internal server error
104 2023-05-01T12:46:00 1 User456 logged in
105 2023-05-01T12:50:00 2 User456 accessed file ABC
2 2 1