Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 4.77 KB

monotonic-stack.md

File metadata and controls

40 lines (31 loc) · 4.77 KB

Monotonic Stack LeetCode Problems

A collection of LeetCode problems solved using Monotonic Stack pattern techniques, explanations, and complexity analysis.

Problems

Easy

# Problem Language Time Space Explanation
28 Find the Index of the First Occurrence in a String Python O(n) O(n) Explanation
551 Student Attendance Record I Python O(n) O(n) Explanation
896 Monotonic Array Python O(n) O(n) Explanation
1021 Remove Outermost Parentheses Python O(n) O(n) Explanation
1475 Final Prices With a Special Discount in a Shop TypeScript O(n) O(n) Explanation
2913 Subarrays Distinct Element Sum of Squares I JavaScript O(n) O(n) Explanation
3105 Longest Strictly Increasing or Strictly Decreasing Subarray Python O(n) O(n) Explanation

Medium

# Problem Language Time Space Explanation
116 Populating Next Right Pointers in Each Node Python O(n) O(n) Explanation
117 Populating Next Right Pointers in Each Node II JavaScript O(n) O(n) Explanation
241 Different Ways to Add Parentheses Python O(n) O(n) Explanation
464 Can I Win Python O(n) O(n) Explanation
739 Daily Temperatures JavaScript, TypeScript O(n) O(n) Explanation
856 Score of Parentheses Python O(n) O(n) Explanation
1081 Smallest Subsequence of Distinct Characters C++ O(n) O(n) Explanation
1249 Minimum Remove to Make Valid Parentheses Python O(n) O(n) Explanation
3737 Count Subarrays With Majority Element I Java O(n) O(n) Explanation

Hard

# Problem Language Time Space Explanation
84 Largest Rectangle in Histogram JavaScript, TypeScript O(n) O(n) Explanation
3250 Find the Count of Monotonic Pairs I JavaScript O(n) O(n) Explanation
3251 Find the Count of Monotonic Pairs II JavaScript O(n) O(n) Explanation