Stock Price Tracker (Online Stock Span)

Stock Price Tracker

Implement an online stock price tracker. Stock prices arrive one day at a time in chronological order. For each incoming price price, immediately output its stock span.

...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: