Input
add(1); add(2); add(3)
Output
median() after each step: 1, 1.5, 2
A teammate built a live median tracker — `add(value)` inserts a number, `median()` returns the current median over everything inserted so far — using the standard two-heap technique. The code looks reasonable and the sm...
median_tracker.pyEditable starteradd(1); add(2); add(3)
median() after each step: 1, 1.5, 2
add(9); add(8); add(7); add(6)
median() after each step: 9, 8.5, 8, 7.5
How would you extend this to support `remove(value)` efficiently — say, for a sliding-window median over a stream?