Loading
2 posts about previous greater element by 1 contributor.
Know previous greater element? Share what you know with developers who are learning it.
Find the maximum number of people visible in a line. This problem is solved efficiently using a monotonic stack to find previous and next greater elements.
Master the Stock Span Problem with the Monotonic Stack pattern. Efficiently find consecutive days with lower or equal stock prices in O(n) time.
DevSocialUpcoming · 3rd editionAI Agents ConferenceNov 23–27, 2026Live onlineMembers only16days leftRegisterPublish an article in this category and earn +1,000 SHARP when it is approved.
Write an article