#monotonicstack search results
Solved the Stock Span Problem using a Monotonic Decreasing Stack ๐ช. Efficiently computed spans in O(n) by storing indices instead of values! ๐๐ฅ #DSA #Stack #MonotonicStack #CodingJourney @harshbhaiyaa @ankurdotio @sheryians_
Solved Next Greater Element I using a ๐ monotonic decreasing stack! Preprocessed nums2 in O(n), mapped next greater, and answered nums1 in O(1) lookups. From brute to beauty. ๐ #JavaScript #LeetCode #MonotonicStack #DSA #100DaysOfCode
LeetCode 84: Largest Rectangle in Histogram ๐ Each barโs height ร its width = possible rectangle area. Track the max area while popping from the stack ๐ฅ โฑ๏ธ O(n) time โ elegant and efficient! #LeetCode #DSA #MonotonicStack #Coding
Surprise triple header today! Adding: 3. Next Greater Element ๐ The monotonic stack trifecta is complete! Key points: Stack to track elements Pop when we find a greater element Efficient O(n) solution ๐ช #CodingChallenge #DSA #MonotonicStack #ProblemSolving
๐ฅ Day 21 | Stock Span Problem ๐ Used Stack to efficiently track previous greater elements, achieving O(N) time. Learned how to handle stock price comparisons smartly. #ProblemSolving #Stack #MonotonicStack #CodingJourney #KeepGrinding
๐งต Day 301 of #geekstreak2025 โ GFG POTD: Sum of Subarray Minimums ๐ง Used monotonic stack to find previous and next smaller elements. Each elementโs contribution = val ร (# of subarrays where itโs the min). Clean math, powerful stack. ๐ #dsa #monotonicstack #array #math
Day 82: 365 Days of DSA Challenge ๐ก Problem: Sum of Subarray Minimums - Time Complexity: O(N), where N is the length of the array. - Space Complexity: O(N) for the stack and result storage. #365DaysOfDSA #MonotonicStack #ProblemSolving
LeetCode 84: Largest Rectangle in Histogram ๐ Each barโs height ร its width = possible rectangle area. Track the max area while popping from the stack ๐ฅ โฑ๏ธ O(n) time โ elegant and efficient! #LeetCode #DSA #MonotonicStack #Coding
1๏ธโฃ DSA โ Stack Problems ๐ธ Next Greater Element I ๐ leetcode.com/problems/next-โฆ ๐ Approach: โข Use stack + map โข Traverse from right โ track next greater using stack โข Map results for nums1 #DSA #Stack #MonotonicStack
Solved Next Greater Element I using a ๐ monotonic decreasing stack! Preprocessed nums2 in O(n), mapped next greater, and answered nums1 in O(1) lookups. From brute to beauty. ๐ #JavaScript #LeetCode #MonotonicStack #DSA #100DaysOfCode
๐ Previous Smaller Element โ Solved optimally in O(n) using a Monotonic Stack. A foundational pattern for problems like Histogram, Stack Span (in reverse), and more. ๐LeetCode-style approach #MonotonicStack #Leetcode #DSAinCPP #LearningJourney
Solved the Stock Span Problem using a Monotonic Decreasing Stack ๐ช. Efficiently computed spans in O(n) by storing indices instead of values! ๐๐ฅ #DSA #Stack #MonotonicStack #CodingJourney @harshbhaiyaa @ankurdotio @sheryians_
๐งต Day 301 of #geekstreak2025 โ GFG POTD: Sum of Subarray Minimums ๐ง Used monotonic stack to find previous and next smaller elements. Each elementโs contribution = val ร (# of subarrays where itโs the min). Clean math, powerful stack. ๐ #dsa #monotonicstack #array #math
Surprise triple header today! Adding: 3. Next Greater Element ๐ The monotonic stack trifecta is complete! Key points: Stack to track elements Pop when we find a greater element Efficient O(n) solution ๐ช #CodingChallenge #DSA #MonotonicStack #ProblemSolving
Solved Next Greater Element I using a ๐ monotonic decreasing stack! Preprocessed nums2 in O(n), mapped next greater, and answered nums1 in O(1) lookups. From brute to beauty. ๐ #JavaScript #LeetCode #MonotonicStack #DSA #100DaysOfCode
LeetCode 84: Largest Rectangle in Histogram ๐ Each barโs height ร its width = possible rectangle area. Track the max area while popping from the stack ๐ฅ โฑ๏ธ O(n) time โ elegant and efficient! #LeetCode #DSA #MonotonicStack #Coding
๐ฅ Day 21 | Stock Span Problem ๐ Used Stack to efficiently track previous greater elements, achieving O(N) time. Learned how to handle stock price comparisons smartly. #ProblemSolving #Stack #MonotonicStack #CodingJourney #KeepGrinding
Day 82: 365 Days of DSA Challenge ๐ก Problem: Sum of Subarray Minimums - Time Complexity: O(N), where N is the length of the array. - Space Complexity: O(N) for the stack and result storage. #365DaysOfDSA #MonotonicStack #ProblemSolving
๐ก Day 92: Next Greater Element ๐ ๐น Given an array, find the next greater element (NGE) on the right. ๐น Approaches: โ Stack-based (O(N), efficient). โ Brute force (O(Nยฒ), slow). ๐น Use Cases: โ๏ธ Stock span โ๏ธ #GfG160 #MonotonicStack #DSA #NextGreaterElement
Something went wrong.
Something went wrong.
United States Trends
- 1. Texas 156K posts
- 2. #JimmySeaFanconD1 296K posts
- 3. 3-8 Florida 2,149 posts
- 4. #HookEm 10.7K posts
- 5. Austin Reaves 13K posts
- 6. Sark 5,219 posts
- 7. Jeff Sims 1,701 posts
- 8. Arch 25.2K posts
- 9. Aggies 9,392 posts
- 10. #DonCheadleDay 1,268 posts
- 11. Life is 10% 2,644 posts
- 12. Georgia 49.4K posts
- 13. Marcel Reed 4,485 posts
- 14. Elko 3,077 posts
- 15. Arizona 32.5K posts
- 16. #LakeShow 3,782 posts
- 17. Katie Miller 2,656 posts
- 18. Sylus 97.8K posts
- 19. Kentucky and Mississippi State N/A
- 20. Longhorns 8,348 posts