Data Structures & AlgorithmsHardCodeforces Div2 B-D · ICPC regional

Closed meeting intervals [1,3], [3,4], [2,5], [6,7] cannot share a room if they overlap even at one point. What is the minimum number of rooms?

  1. A. 3
  2. B. 4
  3. C. 2
  4. D. 5

Correct answer: A. 3

Closed intervals sharing an endpoint overlap, so starts are processed before ends at equal times. At time 3 the intervals [1,3], [3,4] and [2,5] all overlap, giving three rooms.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic