Online Stock Span Leetcode solution stack Hindi Explained | Data structure & Algorithms Hello World
This is the video under the series of DATA STRUCTURE & ALGORITHM in a STACK Playlist. Now we are going to solve a stack problem Online Stock Span Leetcode. Previous Greater Element Join My Telegram channel for more Updates: https://telegram.me/helloworldbyprince complete DSA preparation: https://github.com/Prince-1501/Complete-DSA-Preparation ---------------------------------------------------------------------------------------- ► 901. Online Stock Span Design an algorithm that collects daily price quotes for some stock and returns the span of that stock's price for the current day. The span of the stock's price today is defined as the maximum number of consecutive days (starting from today and going backward) for which the stock price was less than or equal to today's price. For example, if the price of a stock over the next 7 days were [100,80,60,70,60,75,85], then the stock spans would be [1,1,1,2,1,4,6]. Implement the StockSpanner class: StockSpanner() Initializes the object of the class. int next(int price) Returns the span of the stock's price given that today's price is price. Input ["StockSpanner", "next", "next", "next", "next", "next", "next", "next"] [[], [100], [80], [60], [70], [60], [75], [85]] Output [null, 1, 1, 1, 2, 1, 4, 6] Explanation StockSpanner stockSpanner = new StockSpanner(); stockSpanner.next(100); // return 1 stockSpanner.next(80); // return 1 stockSpanner.next(60); // return 1 stockSpanner.next(70); // return 2 stockSpanner.next(60); // return 1 stockSpanner.next(75); // return 4, because the last 4 prices (including today's price of 75) were less than or equal to today's price. stockSpanner.next(85); // return 6 ►Online Stock Span: https://leetcode.com/problems/online-stock-span/ ►Stock span problem: https://practice.geeksforgeeks.org/problems/stock-span-problem-1587115621/1 ► Code In this video: https://github.com/Prince-1501/Hello_world-Competiitve-Programming/blob/master/Leetcode/stack/Online%20Stock%20Span.cpp ---------------------------------------------------------------------------------------- *Follow me * LinkedIn► https://www.linkedin.com/in/iamprince/ Facebook► https://www.facebook.com/helloworldofficials/ Instagram► https://www.instagram.com/helloworldbyprince/ Twitter► https://twitter.com/prince_king_ Telegram► https://telegram.me/helloworldbyprince ---------------------------------------------------------------------------------------- ►Our Playlists on:- ► Tree: https://youtube.com/playlist?list=PLzjZaW71kMwQ-JABTOTypnpRk1BnD2Nx4 ► Stack: https://youtube.com/playlist?list=PLzjZaW71kMwRTtDWYVPvkJypUpKWbuT7_ ► Hashing: https://youtube.com/playlist?list=PLzjZaW71kMwQ-D3oxCEDHAvYu8VC1XOsS ► Graph: https://youtube.com/playlist?list=PLzjZaW71kMwSrxEtvK5uQnfNQ9UjGGzA- ► Matrix: https://youtube.com/playlist?list=PLzjZaW71kMwRff0CCcrB93srEiQhJoOzg ► STL: https://youtube.com/playlist?list=PLzjZaW71kMwR-oGkXfxfz4dmVe2dkNh0K ► Leetcode: https://youtube.com/playlist?list=PLzjZaW71kMwQRAtBdJAq3u64ZEw-0wxgI ►Competitive Programming: https://youtube.com/playlist?list=PLzjZaW71kMwTGbP1suqY16w1VSb9ZNuvE ►C++ Full Course : https://youtube.com/playlist?list=PLzjZaW71kMwRba0ojzshdrmR_NueVeMJv ►Algorithms: https://www.youtube.com/watch?v=7aB650S72CQ&list=PLzjZaW71kMwQWnV474_y1twD9_5qS85Mu ►Data Structure: https://www.youtube.com/playlist?list=PLzjZaW71kMwQVEuI4I0Yj0NnsV-km-Jt_ ------------------------------------------------------------------------ 🌟 Please leave a LIKE ❤️ and SUBSCRIBE for more AMAZING content! 🌟 ✨ Tags ✨ leetcode problems leetcode problems java leetcode problems python leetcode problems that got me tired leetcode problems c++ leetcode problems and solutions python leetcode problems playlist leetcode problems and solutions java leetcode problems in Hindi leetcode problems javascript leetcode problems and solutions leetcode problems of the day leetcode problems for beginners leetcode problems easy leetcode problems js Introduction to the graph data structure stack practice problems stack practice problems gfg leetcode stack questions leetcode stack queue stack hello world MIn stack leetcode solution Get Min at pop gfg stock span problems question asked in Google off-campus placement Online Stock Span Practice stack data structure Stack in a data structure in Hindi Stack Full playlist for Beginners algorithms graph data structure sorting algorithms algorithm analysis gate computer science preparation programming languages #stack #Leetcode #programming
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.