30:00
Given an array nums and an integer k, return an array of the median of each window of size k moving from left to right.
1≤k≤nums.length≤1051 \leq k \leq \text{nums.length} \leq 10^51≤k≤nums.length≤105
−231≤nums[i]≤231−1-2^{31} \leq \text{nums}[i] \leq 2^{31} - 1−231≤nums[i]≤231−1
nums: [1, 3, -1, -3, 5, 3, 6, 7], k=3
Array with Sliding Window (k=3)
1
0
3
-1
2
-3
5
4
6
7
Window:
[0, 2]
Result:
[]