IBM interview question

Meeting Room 2 on leetcode