Company: Barco_12nov
Difficulty: medium
Classroom Seating Problem Description A classroom has N seats numbered 1 to N , and N students numbered 1 to N . Every seat is empty to begin with. Student i has a preferred seat A[i] . The students walk in one at a time, student 1 first, then student 2 , and so on. A student heads straight for their preferred seat: If that seat is still empty, the student takes it. If it is already taken, the student keeps checking the next seat number, and after seat N wraps around to seat 1 , until an empty seat is found. Because there are exactly as many seats as students, every student always finds a seat. Report who ends up in each seat. Function Description Complete the function solve : int N : the number of seats, which equals the number of students. int A[N] : A[i] is the preferred seat of student i + 1 . Returns int[N] : the element at position i is the number of the student sitting in seat i + 1 . Input Format The first line contains the integer N . The second line contains N space-separated