Seat students from different branches so that no two students of the same branch sit next to each other.
Skills: Python / C++, sorting, greedy algorithms, CSV
A real headache for exam coordinators every semester
Before every exam, the coordinator arranges seats in each hall so that students of the same branch do not sit side by side. Doing this by hand for hundreds of students takes hours.
Each hall has R rows and C benches per row. The input is a list of roll numbers with their branch (for example CSE, MECH, CIVIL, ENTC).
Create a free student account to submit your work, get mentor feedback and unlock the reference solution.