DSC-Banasthali-Vidyapith / Code-Crossroad

This project contains the carefully compiled Data Structures & Algorithm questions asked by the companies that visit Banasthali Vidyapith on-campus.
MIT License
55 stars 78 forks source link

Stock Span Problem #124

Open Vanshikagarg17 opened 2 years ago

Vanshikagarg17 commented 2 years ago

Question : The stock span problem is a financial problem where we have a series of n daily price quotes for a stock and we need to calculate span of stock’s price for all n days. The span Si of the stock’s price on a given day, i is defined as the maximum number of consecutive days just before the given day, for which the price of the stock on the current day is less than or equal to its price on the given day.

neilotpal commented 2 years ago

Please assign this issue to me, I would like to solve this problem in C++ language in O(n) Time Complexity and O(n) Auxiliary Space

Ananyaas commented 2 years ago

@neilotpal you can work on this issue. All the best!

pratisth2 commented 2 years ago

Please assign this issue to me. Language=C++ Time complexity=o(n) Space Complexity=o(n) Thank you

shrutigrover25 commented 2 years ago

Can you assign me this issue Language - C++ Time complexity-O(n)