Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 450 Bytes

File metadata and controls

12 lines (9 loc) · 450 Bytes

Problem 14: Dynamic Centrality

Problem Statement

Given an integer array nums and an integer k, there is a sliding window of size k which is moving from the very left of the array to the very right. Return the median array for each window in the original array.

Input Format

  • An array of integers nums.
  • An integer k.

Example

Input: nums = [1, 3, -1, -3, 5, 3, 6, 7], k = 3
Output: [1.0, -1.0, -1.0, 3.0, 5.0, 6.0]