You recently joined Amazon to work in the deal team. The team is preparing to host a service that will allow anyone to get the top longest standing product prices.
Given access to the logs of price changes and the dates, help your team to deliver this api.
Example: (Log format: timestamp product_id new-price)
Today is 2020-12-03
(until today) -> 8 days at 110
Top standing price is 100
- > Explanation - 100 has been the price for 5+10 (15) days, 200 has been the price for 12 days