← Questions
Sliding window median
0
I was asked this
No reports yet. Sign in to say where you were asked it.
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.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding
