Sliding window median

0
Remix

Given an array and a window size k, return the median of every window as it slides one step at a time. Keep two heaps (or a sorted container) and remove elements leaving the window, lazily if needed.

MetaTechnical phone screenLast asked Jul 2025
No answer yet. Write the first one; the best answer gets endorsed.