Search
⌘K

Leetcode 2054. Two Best Non-Overlapping Events

Given a set of weighted intervals, pick at most two non-overlapping events (events are inclusive, so the next must start at least end+1) to maximize the sum of their values. This is a weighted two-interval selection problem that is typically solved by sorting events and using binary search or a prefix/suffix max sweep to find the best compatible pair.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.