LeetCode 844: Backspace String Compare
A clear explanation of the Backspace String Compare problem using stack simulation and an O(1) space two-pointer scan.
51 notes
A clear explanation of the Backspace String Compare problem using stack simulation and an O(1) space two-pointer scan.
A clear explanation of making a parentheses string valid using greedy counting.
A clear explanation of summing subarray minimums using a monotonic stack and contribution counting.
A clear explanation of Online Stock Span using a monotonic decreasing stack with accumulated spans.
A clear explanation of designing a stack that pops the most frequent value, breaking ties by most recent insertion.
A clear explanation of scoring a balanced parentheses string using depth counting.
A clear explanation of counting car fleets by sorting cars by position and tracking arrival times.
A clear explanation of solving Validate Stack Sequences by simulating stack push and pop operations.
A clear explanation of evaluating arithmetic expressions with parentheses, precedence, and integer division.
A clear explanation of simplifying algebraic expressions by parsing, substituting variables, and combining polynomial terms.
A clear explanation of designing a stack that supports push, pop, top, peekMax, and popMax.
Find how many days each temperature must wait for a warmer future day using a monotonic stack.
Simulate asteroid collisions using a stack that keeps the surviving asteroids in order.
Parse a chemical formula with nested parentheses, atom names, and multipliers using recursive descent.
Simulate a baseball scoring system using a stack to process operations and compute the final score.
Check whether a string containing parentheses and wildcard stars can be made valid using a greedy range of possible open counts.
A stack-based solution for computing exclusive execution time from nested start and end logs.
A detailed explanation of implementing a FIFO queue using two LIFO stacks with amortized constant time operations.
A clear explanation of finding the kth smallest value in a binary search tree using inorder traversal.
A detailed explanation of evaluating arithmetic expressions with stack-based parsing and operator precedence.
A clear stack-based parser for validating nested XML-like tags with CDATA sections.
A clear DFS solution for returning the postorder traversal of an N-ary tree.
A clear DFS solution for returning the preorder traversal of an N-ary tree.
A clear explanation of finding the next greater element in a circular array using a monotonic stack.
A clear explanation of finding the next greater element using a monotonic decreasing stack and hash map.
A clear explanation of constructing the lexicographically smallest permutation that matches an I and D pattern.
A clear explanation of detecting a 132 pattern using reverse traversal and a monotonic stack.
Add two numbers stored in forward-order linked lists using stacks and carry propagation.
Evaluate a nested ternary expression using a right-to-left stack parser.
A clear explanation of the Remove K Digits problem using a greedy monotonic stack.
A clear explanation of decoding nested repeat expressions using a stack.
A clear explanation of computing the longest absolute path to a file from a serialized file system string using path lengths by depth.
A clear explanation of parsing a serialized nested integer string using a stack.
A clear explanation of Flatten Nested List Iterator using lazy stack-based flattening.
A clear explanation of verifying preorder serialization using slot counting without reconstructing the tree.
A clear explanation of Remove Duplicate Letters using a greedy monotonic stack.
A clear explanation of the Verify Preorder Sequence in Binary Search Tree problem using a monotonic stack and lower bound tracking.
A clear explanation of implementing a LIFO stack using only FIFO queue operations.
A clear explanation of evaluating an expression with plus, minus, spaces, and parentheses using a stack.
A detailed guide to solving Binary Tree Inorder Traversal with recursion and an iterative stack.
A detailed guide to solving Maximal Rectangle by converting each matrix row into a histogram and applying a monotonic stack.
A detailed guide to solving Largest Rectangle in Histogram with a monotonic increasing stack.
A clear explanation of designing an iterator over a BST using controlled inorder traversal with a stack.
A clear explanation of designing a stack that can return the current minimum element in constant time.
Evaluate an arithmetic expression written in Reverse Polish Notation using a stack.
Return the postorder traversal of a binary tree using recursion or an iterative stack-based approach.
Return the preorder traversal of a binary tree using recursion or an explicit stack.
A clear guide to simplifying Unix-style file paths using a stack.
A clear explanation of finding the longest well-formed parentheses substring using a stack of indices.
A detailed explanation of checking whether a bracket string is valid using a stack.
Array and linked stack implementations covering push, pop, monotonic stacks, expression evaluation, and thread-safe variants.