Back to Questions

Design a Stock Price Fluctuation Tracker

58.1K viewsAsked at Spotify
Medium

Question Explain

Design a data structure that allows you to record a new stock price and immediately retrieve the maximum, minimum, and current price in $O(1)$ time. Use two heaps and a single variable.

Start Trying This Question Simulation

Practice answering orally or with text to get instant AI feedback.

Practice with This Question