Skip to content

Latest commit

 

History

History
27 lines (24 loc) · 4.86 KB

monotonic-stack-filtering.md

File metadata and controls

27 lines (24 loc) · 4.86 KB

Monotonic Stack Filtering Algorithm Problems

A curated selection of LeetCode problems solved using the Monotonic Stack Filtering algorithmic approach.

Problems

# Problem Difficulty Pattern Time Space Explanation
28 Find the Index of the First Occurrence in a String Easy Monotonic Stack O(n) O(n) Explanation
84 Largest Rectangle in Histogram Hard Monotonic Stack O(n) O(n) Explanation
116 Populating Next Right Pointers in Each Node Medium Monotonic Stack O(n) O(n) Explanation
117 Populating Next Right Pointers in Each Node II Medium Monotonic Stack O(n) O(n) Explanation
241 Different Ways to Add Parentheses Medium Monotonic Stack O(n) O(n) Explanation
464 Can I Win Medium Monotonic Stack O(n) O(n) Explanation
551 Student Attendance Record I Easy Monotonic Stack O(n) O(n) Explanation
739 Daily Temperatures Medium Monotonic Stack O(n) O(n) Explanation
856 Score of Parentheses Medium Monotonic Stack O(n) O(n) Explanation
896 Monotonic Array Easy Monotonic Stack O(n) O(n) Explanation
1021 Remove Outermost Parentheses Easy Monotonic Stack O(n) O(n) Explanation
1081 Smallest Subsequence of Distinct Characters Medium Monotonic Stack O(n) O(n) Explanation
1249 Minimum Remove to Make Valid Parentheses Medium Monotonic Stack O(n) O(n) Explanation
1475 Final Prices With a Special Discount in a Shop Easy Monotonic Stack O(n) O(n) Explanation
2913 Subarrays Distinct Element Sum of Squares I Easy Monotonic Stack O(n) O(n) Explanation
3105 Longest Strictly Increasing or Strictly Decreasing Subarray Easy Monotonic Stack O(n) O(n) Explanation
3250 Find the Count of Monotonic Pairs I Hard Monotonic Stack O(n) O(n) Explanation
3251 Find the Count of Monotonic Pairs II Hard Monotonic Stack O(n) O(n) Explanation
3737 Count Subarrays With Majority Element I Medium Monotonic Stack O(n) O(n) Explanation