Exactly x Meetings

Asked at GoogleOnsite

Reported by the problem's creator, not verified

Each meeting is given as [start, end] and is active on the half-open time range [start, end).

Examples

  1. Example 1

    Input: meetings = [[1,4],[2,5],[4,6]], x = 2

    Output: [[2,5]]

    Explanation: One meeting is active on [1, 2), two on [2, 4), and still two on [4, 5): the meeting ending at 4 is replaced by the one starting at 4. The two stretches with count 2 merge into the single interval [2, 5); on [5, 6) only one meeting is active.

Import your own questions
Paste a question you were asked and get a full problem: statement, tests and a checked solution.
Import a question

Code

Loading editor…

Ln 1, Col 1

Start an attempt to use Coach.