Dsa
Queue
Medium
Emergency Room Patient Management
You are managing an emergency room where patients arrive with various levels of urgency, represented by a priority number. High numbers indicate a higher urgency. You must determine the order in which patients are treated based on their urgency.
Input Format:
- The first line contains an integer n (number of patients).
- The next n lines each contain a single integer indicating the urgency of each patient.
Output Format:
- Output the order of patient indices (1-based) as they are treated, starting from the most urgent.
Example Input:
5
3
6
2
5
1
Example Output:
2
4
1
3
5
Key concepts
queuepriorityhealthcare
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