There are infinite seats in a bus. There are $n$ people in a queue waiting to board the bus, and each wants to board and sit as seat $arr[i]$. It is given that the seat desired by each person is between $1$ and $n$. The allotment is done in the following manner:
Find the final seat number allotted to each person in the queue. There are at most $10^5$ people in the queue.