Before showing a "you're free all day" badge, a calendar widget checks a person's meetings for clashes. Each meeting is [start, end]. A meeting that starts exactly when another ends doesn't clash with it.
Write isClashFree(meetings) that returns true if no two meetings overlap, and false otherwise.
Input: meetings = [[7,10],[2,4]] Output: true
The meetings are far apart.
Input: meetings = [[0,40],[10,15],[20,25]] Output: false
[10, 15] happens during [0, 40].
0 <= meetings.length <= 1000000 <= start < end <= 10^6Run tries your code on the examples. Submit runs every test, including hidden edge cases and big inputs that check your code is fast enough, and solves the problem when they all pass.
Ctrl + Enter runs, Ctrl + Shift + Enter submits (⌘ on a Mac).
I'm here to help with #581 Clash-Free Calendar Check. I give hints, never the solution, so you get to solve it yourself. Ask for a hint, select code to ask about it, or press Ask Tuto why on a failing test.
Your first 3 answers need no account. for free to keep asking.