dsa7 min read
My Calendar III: Sweep Line, Difference Arrays, and Lazy Segment Trees for K-Booking
Solve LeetCode 732 My Calendar III using a sweep-line difference array in O(n) per booking, then upgrade to a dynamic lazy segment tree with coordinate compression for O(log n) range updates and max queries.
Read →