Leetcode 2034. Stock Price Fluctuation
Design a data structure that maintains timestamp→price records which may arrive out-of-order and be corrected later, supporting efficient update(timestamp, price) and queries for the current price (price at the latest timestamp) as well as the global maximum and minimum prices. The key challenge is handling corrections and duplicates while keeping current/max/min queries fast.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Your account is free and you can post anonymously if you choose.