Dsa
Sorting
Easy
Event Time Sorting
You are tasked with organizing a series of events scheduled throughout the day. Each event has a name and a start time in the format 'HH:MM'. Your goal is to sort the events by their start time. If two events have the same start time, list them alphabetically by their name. Print the sorted list of events.
Input Format:
- The first line contains an integer N (1 <= N <= 1000), the number of events.
- The next N lines each contain the event name followed by its start time.
Output Format:
- Print each event in the format 'EventName starts at HH:MM'.
Example:
Input:
3
Conference 10:00
Workshop 09:30
Meeting 10:00
Output:
Workshop starts at 09:30
Conference starts at 10:00
Meeting starts at 10:00
Key concepts
sortingdatetime
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now