Pregunta de entrevista de Meta

An algorithm question. Similar to meeting room.