Dsa
Queue
Medium
Customer Support Tickets
You are developing a customer support ticketing system where each ticket has a type and a priority. High-priority tickets (lower number) must be addressed first, and within the same priority, the order of arrival matters. Your task is to implement a system that processes the tickets based on their priority. The input consists of the number of tickets followed by ticket descriptions in the format '<type> <priority>'. Output the types of tickets in the order they will be addressed.
Example Input:
5
technical 1
billing 2
technical 1
sales 3
billing 1
Example Output:
technical
thecnical
billing
billing
sales
Key concepts
queuesupportpriority
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