Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 901. Online Stock Span
Given a stream of daily stock prices, implement an online data structure that returns for each new price the number of consecutive days (including today) the price was less than or equal to the current price. The common optimal approach uses a monotonic decreasing stack that aggregates spans to achieve amortized O(1) time per query.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Mid February, 2025
Meta
Mid-level
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.