Stack Flashcards
(1 cards)
1
Q
Stock Span Problem
https://practice.geeksforgeeks.org/problems/stock-span-problem-1587115621/1/?track=DSASP-Stack&batchId=154
A
We check if the current top is less then the current element and if it is we keep on poping. Like this we reach the end and can find the previous greater element.