Data Structures
Hash maps, stacks, heaps, linked lists, trees, tries and union find.
256 problems.
Array
- Happy Plant Days · Easy
- Library Fine Slips · Easy
- Museum Exit Tally · Medium
- Rainy Streak · Easy
Design
- Browser History Tabs · Medium
- Day-Old Bakery · Medium
- Design Circular Queue · Medium
- Folder Size Ledger · Medium
- LFU Cache · Hard
- Mural Time-Lapse · Medium
- Raffle Drum · Medium
- Sticker Copies Board · Hard
- Text Editor Cursor · Medium
- Two-Ended Shelf · Medium
Hash map
- Bakery Full Batches · Easy
- Brick Wall · Medium
- Cable Car Pairs · Medium
- Contains Duplicate II · Easy
- Contains Duplicate · Easy
- Degree of an Array · Easy
- Determine if Two Strings Are Close · Medium
- Digit Sum Groups · Easy
- Find All Duplicates in an Array · Medium
- Find All Numbers Disappeared in an Array · Easy
- Find and Replace Pattern · Medium
- First Missing Positive · Hard
- First Repeat Visitor · Easy
- First Unique Character in a String · Easy
- Fruit Stall Turned Away · Easy
- Group Anagrams · Medium
- Group Shifted Strings · Medium
- Isomorphic Strings · Easy
- Longest Consecutive Sequence · Medium
- Longest Harmonious Subsequence · Easy
- Longest Palindrome · Easy
- LRU Cache · Medium
- Majority Element · Easy
- Matching Photo Frames · Medium
- Matching Sock Pairs · Easy
- Most Requested Song · Easy
- Popular First · Easy
- Ransom Note · Easy
- Redial Credits · Medium
- Roman to Integer · Easy
- Set Mismatch · Easy
- Single Number · Easy
- Snack Pack Pairs · Easy
- Sort Characters by Frequency · Medium
- Trivia Score Bands · Easy
- Two Sum · Easy
- Unique Number of Occurrences · Easy
- Valid Anagram · Easy
- Word Pattern · Easy
Hash set
- Gate Scanner Rejects · Easy
- Intersection of Two Arrays · Easy
- Unclaimed Raffle Tickets · Easy
- Valid Sudoku · Medium
Heap
- Arcade Podium · Medium
- Charging Bay Queue · Medium
- Find K Pairs with Smallest Sums · Medium
- Find Median from Data Stream · Hard
- Furthest Building You Can Reach · Medium
- Hospital Triage · Hard
- IPO · Hard
- K Closest Points to Origin · Medium
- Kth Largest Element in an Array · Medium
- Kth Smallest Element in a Sorted Matrix · Medium
- Last Stone Weight · Easy
- Lighthouse Sightings · Medium
- Merge k Sorted Lists · Hard
- Minimum Cost to Connect Sticks · Medium
- Parcel Lockers · Medium
- Print Shop Schedule · Medium
- Quiz Night Podium · Easy
- Reorganise String · Medium
- Shortest Head First · Medium
- Single-Threaded CPU · Medium
- Ski Lift Waits · Medium
- Top K Frequent Elements · Medium
- Top K Streaming Words · Medium
- Train Platforms · Medium
- Ugly Number II · Medium
Linked list
- Add Two Numbers II · Medium
- Add Two Numbers · Medium
- Insertion Sort List · Medium
- Latest Song Requests · Medium
- Linked List Cycle · Easy
- Merge Alternating Lists · Easy
- Merge Two Sorted Lists · Easy
- Middle of the Linked List · Easy
- Odd Even Linked List · Medium
- Palindrome Linked List · Easy
- Partition List · Medium
- Remove Duplicates from Sorted List II · Medium
- Remove Duplicates from Sorted List · Easy
- Remove Linked List Elements · Easy
- Remove Nth Node From End of List · Medium
- Reorder List · Medium
- Reverse Linked List II · Medium
- Reverse Linked List · Easy
- Reverse Nodes in k-Group · Hard
- Reverse Rising Runs · Medium
- Rotate List · Medium
- Sort List · Medium
- Swap Nodes in Pairs · Medium
Matrix
- Best Market Day · Easy
- Diagonal Traverse · Medium
- Game of Life · Medium
- Rotate Image · Medium
- Search a 2D Matrix II · Medium
- Set Matrix Zeroes · Medium
- Spiral Matrix II · Medium
- Spiral Matrix · Medium
Monotonic deque
- Constrained Subsequence Sum · Hard
- Gentle Trail Sections · Medium
- Jump Game VI · Medium
- Shortest Subarray with Sum at Least K · Hard
Monotonic stack
- Taller Horse Around the Carousel · Medium
- Final Prices With a Special Discount · Easy
- Max Chunks To Make Sorted II · Hard
- Maximum Width Ramp · Medium
- Number of Visible People in a Queue · Hard
- Sum of Subarray Ranges · Medium
Queue
- Council of Rival Guilds · Medium
- Ferry Car Trips · Easy
- Gallery Active Visitors · Medium
- Moving Average from Data Stream · Easy
- Number of Recent Calls · Easy
- Printer Queue Rounds · Easy
- Rate Limiter Log · Medium
- Time Needed to Buy Tickets · Easy
Stack
- 132 Pattern · Medium
- Asteroid Collision · Medium
- Basic Calculator II · Medium
- Basic Calculator · Hard
- Car Fleet · Medium
- Crystal Fusion Line · Medium
- Daily Temperatures · Medium
- Decode String · Medium
- Directory Hopper · Medium
- Evaluate Reverse Polish Notation · Medium
- Exclusive Time of Functions · Medium
- Heatwave Span · Medium
- Largest Rectangle in Histogram · Hard
- Layered Settings · Medium
- Lowest Reading Blocks · Medium
- Markup Depth Checker · Medium
- Maximal Rectangle · Hard
- Min Stack · Medium
- Minimum Remove to Make Valid Parentheses · Medium
- Next Greater Element I · Easy
- Next Greater Element II · Medium
- Online Stock Span · Medium
- Popularity Pile · Hard
- Remove All Adjacent Duplicates in String II · Medium
- Remove All Adjacent Duplicates in String · Easy
- Remove Duplicate Letters · Medium
- Remove K Digits · Medium
- Score of Parentheses · Medium
- Simplify Path · Medium
- Sum of Subarray Minimums · Medium
- Undo Editor · Easy
- Valid Parentheses · Easy
- Validate Stack Sequences · Medium
String encoding
- Encode and Decode Strings · Medium
Tree bfs
- Above-Average Shelves · Medium
- All Nodes Distance K in Binary Tree · Medium
- Binary Tree Level Order Traversal · Medium
- Binary Tree Right Side View · Medium
- Binary Tree Zigzag Level Order Traversal · Medium
- Level Sums Zigzag · Easy
- Maximum Width of Binary Tree · Medium
- Minimum Depth of Binary Tree · Easy
Tree dfs
- Balanced Binary Tree · Easy
- Binary Tree Maximum Path Sum · Hard
- Binary Tree Paths · Easy
- Studio Booking Conflicts · Medium
- Findable Archive Records · Medium
- Floor and Ceiling in a BST · Medium
- Median Finish Time · Medium
- Nearest Park Benches · Medium
- Price Window Listing · Easy
- Construct Binary Tree from Inorder and Postorder Traversal · Medium
- Construct Binary Tree from Preorder and Inorder Traversal · Medium
- Convert Sorted Array to BST · Easy
- Count Good Nodes in Binary Tree · Medium
- Count Nodes in Range of a BST · Easy
- Delete Node in a BST · Medium
- Diameter of Binary Tree · Easy
- Family Distance · Medium
- Flatten Binary Tree to Linked List · Medium
- Hopscotch Trail · Easy
- Insert into a Binary Search Tree · Medium
- Invert Binary Tree · Easy
- Kth Smallest Element in a BST · Medium
- Lowest Common Ancestor of a Binary Search Tree · Medium
- Lowest Common Ancestor of a Binary Tree · Medium
- Maximum Depth of Binary Tree · Easy
- Message Hops · Medium
- Non-Decreasing Root Paths · Easy
- Path Sum II · Medium
- Downward Paths With a Given Sum · Medium
- Path Sum · Easy
- Range Sum of BST · Easy
- Same Tree · Easy
- Search in a Binary Search Tree · Easy
- Serialize and Deserialize Binary Tree · Hard
- Slanted Sunbeams · Medium
- Solo Supervisors · Easy
- Subtree of Another Tree · Easy
- Sum of Left Leaves · Easy
- Sum Root to Leaf Numbers · Medium
- Symmetric Tree · Easy
- Trim a Binary Search Tree · Medium
- Two Sum in a BST · Easy
- Validate Binary Search Tree · Medium
- Widest Spread Level · Easy
Tree dp
- Best Depot Town · Hard
- Festival Lights Tree · Medium
- Mentor Pairs · Medium
- Scenic Cable Tour · Hard
- Trail Signal Towers · Hard
Trie
- Autocomplete Top Word · Medium
- Concatenated Words · Hard
- Count Prefix and Suffix Pairs · Medium
- Design Add and Search Words Data Structure · Medium
- Fewest Phrases · Medium
- Fewest Sign Tiles · Medium
- Implement Trie (Prefix Tree) · Medium
- Longest Word in Dictionary · Medium
- Map Sum Pairs · Medium
- Maximum XOR Pair · Medium
- Palindrome Pairs · Hard
- Postcode District Counts · Medium
- Prefix Popularity Score · Medium
- Replace Words · Medium
- Search Suggestions System · Medium
- Shortest Locker Stickers · Medium
- Strongest Cable Path · Hard
- Typo-Tolerant Lookup · Medium
- Word Search II · Hard
- Worn Label Matches · Medium
Union find
- Accounts Merge · Medium
- Convoy Reachable Towns · Hard
- Fence Painting · Hard
- First Contradiction · Medium
- Largest Village Cluster · Medium
- Longest Lit Stretch · Medium
- Most Stones Removed with Same Row or Column · Medium
- Number of Provinces · Medium
- Pen Pal Circles · Medium
- Ratio Chains · Medium
- Redundant Connection · Medium
- Satisfiability of Equality Equations · Medium
- Smallest String With Swaps · Medium
- Storm Road Closures · Hard