Ordered Set
14 problems · 5 with full explanations
1 Easy3 Medium3 Hard
An ordered set (e.g., SortedSet<T> in C#) maintains elements in sorted order with O(log n) insert/delete/lookup. Use it when you need both fast membership testing and order-based queries (floor, ceiling, predecessor, successor).
How to practice
To practice Ordered Set problems effectively, start with the Easy problems listed below, trace through each solution on paper, then re-implement without looking. When you can recognise the ordered set pattern within 30 seconds of reading a new problem, move on to Medium difficulty. Use the related topic pages and our study guide for a structured progression.
All Ordered Set problems
- 218.The Skyline ProblemHard
- 220.Contains Duplicate IIIHard
- 352.Data Stream as Disjoint IntervalsUnknown
- 699.Falling SquaresHard
- 729.My Calendar IMedium
- 731.My Calendar IIUnknown
- 855.Exam RoomUnknown
- 1912.Design Movie Rental SystemUnknown
- 2353.Design a Food Rating SystemMedium
- 2762.Continuous SubarraysMedium
- 2948.Make Lexicographically Smallest Array by Swapping ElementsUnknown
- 3318.Find X-Sum of All K-Long Subarrays IEasy
- 3321.Find X-Sum of All K-Long Subarrays IIUnknown
- 3408.Design Task ManagerUnknown