A calendar assistant finds clashes in a busy week. Each meeting invite is [start, end]. Two meetings clash if they share any time; a meeting that starts exactly when another ends does not clash with it.
Write fewestToDecline(invites) that returns the smallest number of invites to decline so that the remaining meetings never clash.
Input: invites = [[2,4],[4,6],[6,8],[2,6]] Output: 1
Decline [2, 6]; the other three run back to back.
Input: invites = [[1,2],[1,2],[1,2]] Output: 2
Only one of the three identical meetings can stay.
0 <= invites.length <= 100000-10^6 <= start < end <= 10^6Run tries your code on the examples. Submit runs every test, including hidden edge cases, and solves the problem when they all pass.
Ctrl + Enter runs, Ctrl + Shift + Enter submits (⌘ on a Mac).
I'm here to help with #578 Fewest Invites to Decline. 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.