All problems
› Stack problems
Stack problems
71 Stack DSA practice problems on CampusCode, each with statement, examples and constraints.
358. Add Two Numbers II (No Reverse Allowed)
Medium
Linked List
407. Sum of Two Numbers in Linked List Without Reverse
Hard
Linked List
564. Check Balanced Parentheses
Easy
Stack
565. Reverse a String Using Stack
Easy
Stack
566. Evaluate Postfix Expression
Easy
Stack
567. Convert Infix to Postfix
Easy
Stack
568. Reverse a Stack Using Recursion
Easy
Stack
569. Sort a Stack Using Recursion
Easy
Stack
570. Find Middle Element of Stack
Easy
Stack
571. Delete Middle Element of Stack
Easy
Stack
572. Check if Stack is Palindrome
Easy
Stack
573. Count Occurrences of Element in Stack
Easy
Stack
574. Reverse a Number Using Stack
Easy
Stack
575. Valid Parentheses (Multiple Types)
Easy
Stack
576. Remove All Adjacent Duplicates in String
Easy
Stack
577. Make String Great
Easy
Stack
578. Baseball Game Score
Easy
Stack
579. Reverse First K Elements of Queue
Easy
Stack
583. Check if Queue is Palindrome
Easy
Stack
589. Next Greater Element
Easy
Stack
590. Next Smaller Element
Easy
Stack
591. Previous Greater Element
Easy
Stack
592. Previous Smaller Element
Easy
Stack
593. Stock Span Problem
Easy
Stack
594. Next Greater Element I
Easy
Stack
595. Next Greater Element in Circular Array
Easy
Stack
596. Evaluate Prefix Expression
Easy
Stack
597. Balanced Brackets with Wildcard
Easy
Stack
598. Maximum Nesting Depth of Parentheses
Easy
Stack
600. Convert Decimal to Binary Using Stack
Easy
Stack
601. Delete Consecutive Same Words
Easy
Stack
602. Count Pairs of Matching Parentheses
Easy
Stack
603. Simplify Unix Directory Path
Easy
Stack
604. Score of Parentheses
Easy
Stack
606. Crawler Log Folder
Easy
Stack
608. Next Greater Element II (Circular Array)
Medium
Stack
609. Daily Temperatures
Medium
Stack
610. Largest Rectangle in Histogram
Medium
Stack
612. Decode String (Nested Brackets)
Medium
Stack
613. Asteroid Collision
Medium
Stack
614. 132 Pattern
Medium
Stack
616. Online Stock Span
Medium
Stack
617. Max Width Ramp
Medium
Stack
618. Exclusive Time of Functions
Medium
Stack
631. Number of Visible People in Queue
Medium
Stack
632. Build an Array With Stack Operations
Medium
Stack
633. Validate Stack Sequences
Medium
Stack
634. Count Collisions on a Road
Medium
Stack
635. Minimum Add to Make Parentheses Valid
Medium
Stack
636. Minimum Insertions to Balance Parentheses
Medium
Stack
637. Longest Valid Parentheses
Medium
Stack
638. Number of Atoms
Medium
Stack
646. Buildings With an Ocean View
Medium
Stack
648. Removing Stars From a String
Medium
Stack
649. Count of Students Unable to Eat Lunch
Medium
Stack
651. Check If Word Is Valid After Substitutions
Medium
Stack
652. Implement a Basic Calculator II
Medium
Stack
653. Trapping Rain Water
Hard
Stack
654. Largest Rectangle in Histogram (Optimal)
Hard
Stack
656. Basic Calculator I
Hard
Stack
657. Basic Calculator III
Hard
Stack
658. Longest Valid Parentheses (O(1) Space)
Hard
Stack
659. Remove Invalid Parentheses
Hard
Stack
660. Max Width Ramp (Optimal)
Hard
Stack
663. Number of Visible Pairs in a Queue
Hard
Stack
665. Minimum Swaps to Make String Balanced
Hard
Stack
686. Flatten Binary Tree to Linked List
Hard
Stack
874. Iterative Inorder Traversal Using Stack
Easy
Trees
890. Check if Array is Preorder of BST
Easy
Trees
911. Iterative Postorder Using One Stack
Medium
Trees
927. BST Iterator (In-Order Lazy Evaluation)
Medium
Trees