CP Python LibraryGitHub

Sliding Window Aggregation

Deque-based data structure that holds the product of semi-group operations.

__init__

Arguments

__getitem__

Returns the i-th element of the deque.

Arguments

Returns

Complexities

append

Appends a value to the right end of the deque.

Arguments

Complexities

appendleft

Appends a value to the left end of the deque.

Arguments

Complexities

pop

Removes the rightmost element of the deque.

Returns

Complexities

popleft

Removes the leftmost element of the deque.

Returns

Complexities

prod

Returns the product of all elements in the deque.

Returns

Complexities

Code Test