RoleTheCoder
Roli is really busy with the recently started JS Core and DB Fundamentals modules at SoftUni. She is used to going out with friends on a various events. However, when the times comes, you need to tell her to start coding.
Roli is the organizer of those events, so she needs to keep track of the unique participants for each event. She saves the events by 'ID', which is the unique code for each event. For each ID, she keeps the event name and the participants for it.
She receives request in the following format:
- {id} #{eventName} @{participant1} @{participant2} … @{participantN}
If she is given event in an invalid format (such as without a hashtag), she ignores that line of input. If she is given ID that already exists she needs to check if the eventName is the same. If it is, she adds the participants from the request to the other registered participants. If the event id exists but the name doesn’t, it is invalid and you need to ignore it.
After you receive "Time for Code", you need to print the results. All events must be sorted by participant count in descending order and then by alphabetical order. For each event, the participants must be sorted in alphabetical order.
Input / Constrains
- Unil you receive “Time for Code” you will get lines of input in which everything is separated by one or more blank spaces
- Until you receive "Time for Code", you will be receiving events in the following format:
- {id} #{eventName} @{participant1} @{participant2} … @{participantN}
Output
- All events must be sorted in descending order by participant count and then by alphabetical order. For each event you need to print:
- {eventName} – {participantCount}
- On the next lines you need to print all participants. All participants for an event must be sorted alphabetically.
Гърмят ми доста неща, но не мога да разбера защо. Ето го кодът ми.
Ще съм благодарен, ако някой удари едно рамо!
edit: Пооправих го. Сега ми гърми само третирят тест.