Skip to content
BASA DSA

Meeting Rooms

EasyIntervals

Return whether one person can attend every meeting. Meeting intervals are half-open [start,end), so an ending meeting may be followed immediately by another.

Example 1

Input
intervals = [[5,8],[1,3],[3,5]]
Output
true

Explanation

Sorted meetings end exactly where the next begins, allowing all three.

Example 2

Input
intervals = [[1,4],[3,6]]
Output
false

Explanation

Both meetings occupy times 3..4, so attendance conflicts.

Example 3

Input
intervals = []
Output
true

Explanation

No meetings impose no conflicts.

Constraints

  • 0 <= number of meetings <= 10000
  • Each interval has start < end

Function contractcanAttendMeetingsArguments: json
Loading draft…
SolutionRuns on your device
Loading draft…