Your school classroom cleaning schedule assigns a different student to clean the classroom on each school day. You are given a list of day-to-student assignments. Each day in the given period is assigned exactly once, but the provided assignments may not be in chronological order.
You need to determine two things:
The first line contains an integer (), the number of cleaning assignments.
Each of the next lines contains a single day's assignment:
The two values are separated by a space. You may assume that each day number is unique (no two lines will have the same ).
First, output the list of students and the number of days they are assigned, sorted by the student's name in ascending (alphabetical) order.
Each line should contain the student's name, a space, and then their assigned day count.
After listing all students, output a line that starts with Most: (no spaces) followed by the name of the student who is assigned the most days. If there are multiple students with the highest count, output the one whose name comes first alphabetically.
5.3113 days.6.12212 days, but Bob is lexicographically smaller, so Bob is chosen.No comments yet. Be the first to comment!