Bid lifetime max tracking

Write codeMedium22 minGoogle and Meta style

Your task

An ad exchange records one bid per second for a single slot. The bid that lands in second i is worth amounts[i] cents and stays live for lifetimes[i] seconds, so it can be accepted during seconds i through i + lifetimes[i] - 1. A lifetime of 0 means the bidder pulled it the instant it landed, so it is never live. At the end of every second the exchange publishes the largest amount among the bids still live in that second, or -1 when nothing is live. Return one published number per second, in order. Amounts and lifetimes are never negative, and the two lists have the same length.

Examples

live_bid_peaks(amounts: list[int], lifetimes: list[int]) -> list[int]
Example 1
Inputlive_bid_peaks([50, 90, 40], [3, 1, 2])
Output[50, 90, 50]
Example 2
Inputlive_bid_peaks([70, 20], [1, 1])
Output[70, 20]
Example 3
Inputlive_bid_peaks([80, 30, 30, 10], [1, 4, 1, 1])
Output[80, 30, 30, 30]