Return the maximum of each window of size k. Example: [1,3,2,5,4], k=3 => [3,5,5]
Implement this function:
def sliding_max(lst: list, k: int) -> list:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: lst, k.
Input
[1, 3, 2, 5, 4]
3
Output
[3, 5, 5]