Review: Stack Problems Posted on January 23, 2018July 26, 2020 by braindenny The concept of stack is simple. But the problem could be tricky. It’s not difficult, but might involve lots of details. Basic Abstractions Name Summary Push items to stack VS push indices LeetCode: Reverse Substrings Between Each Pair of Parentheses Push items to stack VS push string LeetCode: Reverse Substrings Between Each Pair of Parentheses Different types of elements in the stack LeetCode: Number of Atoms Don’t forget to push the last segment Delayed initialization Questions Num Problem Summary 1 Recursive deletion during pushing process LeetCode: Verify Preorder Serialization of a Binary Tree 2 Examine whether the input string is valid LeetCode: Asteroid Collision 3 When pushing to stack, whether delayed push LeetCode: Decode String 4 Leetcode: Reverse Substrings Between Each Pair of Parentheses CheatSheet: Leetcode For Code Interview CheatSheet: Common Code Problems & Follow-ups See all stack problems: #stack Review: Stack ProblemsLintCode: MinimumStringLintCode: Input StreamLeetCode: Verify Preorder Serialization of a Binary TreeLeetCode: Validate Stack SequencesLeetCode: Valid ParenthesesLeetCode: Ternary Expression ParserLeetCode: Score of ParenthesesLeetCode: Remove All Adjacent Duplicates in String IILeetCode: Number of AtomsLeetCode: Minimum Remove to Make Valid ParenthesesLeetCode: Minimum Cost Tree From Leaf ValuesLeetCode: Minimum Add to Make Parentheses ValidLeetCode: Mini ParserLeetCode: Maximum Nesting Depth of Two Valid Parentheses StringsLeetCode: Max StackLeetCode: Longest Valid ParenthesesLeetCode: Longest Absolute File PathLeetCode: Exclusive Time of FunctionsLeetCode: Evaluate Reverse Polish NotationLeetCode: Decoded String at IndexLeetCode: Decode StringLeetCode: Construct Binary Tree from StringLeetCode: Check If Word Is Valid After SubstitutionsLeetCode: Basic Calculator IIILeetCode: Basic CalculatorLeetCode: Baseball GameLeetCode: Asteroid CollisionLeetCode: 132 Pattern See more blog posts. Post Views: 6