Meeting Rooms II (Minimum Rooms Required)
Meeting Rooms II (LeetCode 253): find the minimum rooms by sorting start and end times separately and sweeping with two pointers. O(n log n), Python/J...
Arrays, Strings, Sliding Window, Two Pointers, Searching & Binary Search, Sorting, Linked List, Stack & Queue, Recursion & Backtracking, Trees, Heap / Priority Queue, Graphs, Dynamic Programming, Greedy, Bit Manipulation, Trie, Math & Number Theory, Design (LLD / OOP), SQL, System Design (HLD)
185 notes in 20 topics
Meeting Rooms II (LeetCode 253): find the minimum rooms by sorting start and end times separately and sweeping with two pointers. O(n log n), Python/J...
Sort a nearly sorted (k-sorted) array where each element is at most k positions from its place, using a size-(k+1) min-heap in O(n log k). Python/Java...
Pancake Sort (LeetCode 969): sort by repeatedly flipping a prefix to move the current maximum to its place. O(n^2), returns the flip sequence. Python/...
Count Inversions in an array using a modified merge sort that tallies cross-pair inversions during the merge. O(n log n), Python/Java/C++.
Sort an array of 0s, 1s and 2s with counting sort: tally each value then overwrite. O(n), O(1); includes a note on the one-pass Dutch National Flag. P...