Technical phone screen interview question.
190

Given a list of meetings with thier start and end times , for example : {{1,4}, {2,3.5}, {5,7}}
and given a set of queries:

  1. Count meetings at time : 2.5 (return 2)
  2. Count meetings at time: 4 (return 1)
  3. Count meetings at time : 6 (return 1)

Write an O(mlogn) algorithm for the problem, m is the number of queries and n is the number of intervals in the meeting array. Can someone come up with an effecient code?

Comments (2)
No comments yet.