Stock Price Fluctuation — Dual Heap with Timestamp Correction Handling
Track stock prices with out-of-order timestamp updates and corrections, supporting O(log n) current, maximum, and minimum queries using a timestamp map and sorted multiset.
1582 articles
Track stock prices with out-of-order timestamp updates and corrections, supporting O(log n) current, maximum, and minimum queries using a timestamp map and sorted multiset.
Find the minimum number of distinct values to remove to halve the array size by greedily eliminating the most frequent elements first — a clean greedy problem with a frequency max-heap.
LeetCode 2099 solved with a heap-based top-K selection followed by an index-preserving reconstruction. Tests whether you can decouple selection from ordering — a classic FAANG screening pattern.
Complete master recap of the Heaps and Priority Queues section. Covers 7 core heap patterns, complexity tables, and a full FAANG-style problem index for systematic interview preparation.
A complete linked list interview playbook covering 7 core patterns (reversal, fast/slow, dummy head, merge, in-place, clone, design) with copy-paste templates and a curated index of 45 LeetCode problems mapped to every pattern.