Company: Meesho
Difficulty: medium
Bus Seating Allocation For a bus going to Hackerland, there are infinite seats numbered from 1 to infinity, and n people are standing in a queue waiting to be seated. The i th person wants to be seated on the seat numbered arr[i]. The seats are allocated based on the following rules: The seats are allocated in the sequence of the queue i.e. the first person followed by the second person and so on If the seat required by the person in the front of the queue is empty, they are allocated that seat and removed from the queue If the seat required by the person in the front of the queue is occupied, the seat number required by them is incremented by 1 and they are pushed to the end of the queue Given an array arr representing the seat numbers that the people in the queue want, find the final seat number allocated to each person in the queue. Function Description Complete the function getSeatsAllocation in the editor below. getSeatsAllocation has the following parameter: int arr[n]: the order