WeInvest interview question

Coding round about seating arrangement