data_structures.queues.monotonic_queue ====================================== .. py:module:: data_structures.queues.monotonic_queue Attributes ---------- .. autoapisummary:: data_structures.queues.monotonic_queue.arr data_structures.queues.monotonic_queue.expect data_structures.queues.monotonic_queue.window_size Functions --------- .. autoapisummary:: data_structures.queues.monotonic_queue.max_sliding_window Module Contents --------------- .. py:function:: max_sliding_window(arr: list[float], window_size: int) -> list[float] Given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. Each time the sliding window of length window_size moves right by one position. Return the max sliding window. >>> max_sliding_window(arr, window_size) == expect True .. py:data:: arr .. py:data:: expect :value: [3, 3, 5, 5, 6, 7] .. py:data:: window_size :value: 3