Leetcode 2276. Count Integers in Intervals
Maintain a dynamic set of closed integer intervals that supports adding an interval (merging overlaps) and returning the total number of distinct integers covered by the union. The challenge is to efficiently merge intervals and keep track of the union length under up to 1e5 operations with coordinates up to 1e9.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Your account is free and you can post anonymously if you choose.