#K78107. Most Active User
Most Active User
Most Active User
You are given a list of user activities, where each activity is represented by a pair (userID, timestamp). Your task is to determine the most active user.
If there are multiple users with the same maximum number of activities, you should return the one with the smallest lexicographical userID. In other words, if the counts are tied, choose the user \( u_i \) over \( u_j \) if \( u_i < u_j \) in lexicographical order.
The input is provided via stdin and the output should be printed to stdout.
inputFormat
The first line contains an integer \( n \), the number of activities. Each of the following \( n \) lines contains a user ID (a string without spaces) and a timestamp (an integer), separated by a space.
If \( n = 0 \), it means there are no activities.
outputFormat
Output a single line containing the userID of the most active user. If there are no activities, output None
.
1
alice 1609459200
alice
</p>