Loading environment...
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 N lines contains a single days assignment. Each line has:
An integer D (), representing the day number of the school year.
A string , the name of the student assigned to clean on that day.
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 students name in ascending (alphabetical) order.
Each line should contain the students name, a space, and then their assigned day count.
After listing all students, output a line that starts with
5.3113 days.6.12212 days, but Bob is lexicographically smaller, so Bob is chosen.No comments yet. Be the first to comment!