Amazon — DSA Questions
717 problems confirmed in interviews | 2063 total tagged
Priority List (confirmed in interviews)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Number of Islands | Medium | Graph | 20x | LC | ||
| 2 | Course Schedule II | Medium | Depth-First Search, Breadth-First Search, Graph Theory | 20x | LC | ||
| 3 | Rotting Oranges | Medium | Array, Breadth-First Search, Matrix | 18x | LC | ||
| 4 | LRU Cache | Medium | HashMap / Design | 16x | LC | ||
| 5 | Pacific Atlantic Water Flow | Medium | Other | 15x | LC | ||
| 6 | Merge k Sorted Lists | Hard | Linked List, Divide and Conquer, Heap (Priority Queue) | 14x | LC | ||
| 7 | Merge Intervals | Medium | Array, Sorting | 14x | LC | ||
| 8 | Find Median from Data Stream | Hard | Two Pointers, Design, Sorting | 14x | LC | ||
| 9 | Search in Rotated Sorted Array | Medium | Array, Binary Search | 13x | LC | ||
| 10 | Word Ladder | Hard | Hash Table, String, Breadth-First Search | 13x | LC | ||
| 11 | Trapping Rain Water | Hard | Array, Two Pointers, Dynamic Programming | 12x | LC | ||
| 12 | Binary Tree Maximum Path Sum | Hard | Dynamic Programming, Tree, Depth-First Search | 12x | LC | ||
| 13 | Meeting Rooms II | Medium | Array, Two Pointers, Greedy | 12x | LC | ||
| 14 | Jump Game II | Medium | Array, Dynamic Programming, Greedy | 11x | LC | ||
| 15 | Group Anagrams | Medium | Array, Hash Table, String | 11x | LC | ||
| 16 | Word Break | Medium | Array, Hash Table, String | 11x | LC | ||
| 17 | Serialize and Deserialize Binary Tree | Hard | String, Tree, Depth-First Search | 11x | LC | ||
| 18 | Task Scheduler | Medium | Heap / PQ | 11x | LC | ||
| 19 | Longest Substring Without Repeating Characters | Medium | Hash Table, String, Sliding Window | 10x | LC | ||
| 20 | Median of Two Sorted Arrays | Hard | Array, Binary Search, Divide and Conquer | 10x | LC | ||
| 21 | 3Sum | Medium | Array, Two Pointers, Sorting | 10x | LC | ||
| 22 | Course Schedule | Medium | Depth-First Search, Breadth-First Search, Graph Theory | 10x | LC | ||
| 23 | Longest Increasing Subsequence | Medium | DP | 10x | LC | ||
| 24 | Generate Parentheses | Medium | String, Dynamic Programming, Backtracking | 9x | LC | ||
| 25 | Next Permutation | Medium | Array, Two Pointers | 9x | LC | ||
| 26 | Maximum Subarray | Medium | Array, Divide and Conquer, Dynamic Programming | 9x | LC | ||
| 27 | Gas Station | Medium | Array, Greedy | 9x | LC | ||
| 28 | Word Break II | Hard | Array, Hash Table, String | 9x | LC | ||
| 29 | Maximum Product Subarray | Medium | Array, Dynamic Programming | 9x | LC | ||
| 30 | House Robber | Medium | Array, Dynamic Programming | 9x | LC | ||
| 31 | Word Search II | Hard | Array, String, Backtracking | 9x | LC | ||
| 32 | Reconstruct Itinerary | Hard | Array, String, Depth-First Search | 9x | LC | ||
| 33 | Top K Frequent Elements | Medium | Array, Hash Table, Divide and Conquer | 9x | LC | ||
| 34 | Network Delay Time | Medium | Depth-First Search, Breadth-First Search, Graph Theory | 9x | LC | ||
| 35 | Reorganize String | Medium | Hash Table, String, Greedy | 9x | LC | ||
| 36 | Koko Eating Bananas | Medium | Array, Binary Search | 9x | LC | ||
| 37 | K Closest Points to Origin | Medium | Array, Math, Divide and Conquer | 9x | LC | ||
| 38 | Maximum Profit in Job Scheduling | Hard | DP | 9x | LC | ||
| 39 | Two Sum | Easy | Array, Hash Table | 8x | LC | ||
| 40 | Container With Most Water | Medium | Array, Two Pointers, Greedy | 8x | LC | ||
| 41 | Valid Parentheses | Easy | String, Stack | 8x | LC | ||
| 42 | Reverse Nodes in k-Group | Hard | Linked List, Recursion | 8x | LC | ||
| 43 | Insert Interval | Medium | Array | 8x | LC | ||
| 44 | Minimum Window Substring | Hard | Hash Table, String, Sliding Window | 8x | LC | ||
| 45 | Validate Binary Search Tree | Medium | Tree, Depth-First Search, Binary Search Tree | 8x | LC | ||
| 46 | Best Time to Buy and Sell Stock | Easy | Array, Dynamic Programming | 8x | LC | ||
| 47 | Min Stack | Medium | Stack, Design | 8x | LC | ||
| 48 | Implement Trie (Prefix Tree) | Medium | Hash Table, String, Design | 8x | LC | ||
| 49 | Kth Largest Element in an Array | Medium | Array, Divide and Conquer, Sorting | 8x | LC | ||
| 50 | Lowest Common Ancestor of a Binary Tree | Medium | Tree, Depth-First Search, Binary Tree | 8x | LC | ||
| 51 | Sliding Window Maximum | Hard | Array, Queue, Sliding Window | 8x | LC | ||
| 52 | Alien Dictionary | Hard | Array, String, Depth-First Search | 8x | LC | ||
| 53 | Insert Delete GetRandom O(1) | Medium | Array, Hash Table, Math | 8x | LC | ||
| 54 | Remove K Digits | Medium | Other | 8x | LC | ||
| 55 | LFU Cache | Hard | Hash Table, Linked List, Design | 8x | LC | ||
| 56 | Asteroid Collision | Medium | Other | 8x | LC | ||
| 57 | Add Two Numbers | Medium | Linked List, Math, Recursion | 7x | LC | ||
| 58 | Jump Game | Medium | Array, Dynamic Programming, Greedy | 7x | LC | ||
| 59 | Climbing Stairs | Easy | Math, Dynamic Programming, Memoization | 7x | LC | ||
| 60 | Decode Ways | Medium | DP | 7x | LC | ||
| 61 | Construct Binary Tree from Preorder and Inorder Travers | Medium | Array, Hash Table, Divide and Conquer | 7x | LC | ||
| 62 | Reverse Linked List | Easy | Linked List | 7x | LC | ||
| 63 | Kth Smallest Element in a BST | Medium | Tree, Depth-First Search, Binary Search Tree | 7x | LC | ||
| 64 | Coin Change | Medium | Array, Dynamic Programming, Breadth-First Search | 7x | LC | ||
| 65 | Design Twitter | Medium | Hash Table, Linked List, Design | 7x | LC | ||
| 66 | Insert Delete GetRandom O(1) - Duplicates allowed | Hard | Array, Hash Table, Math | 7x | LC | ||
| 67 | Concatenated Words | Hard | Other | 7x | LC | ||
| 68 | Cheapest Flights Within K Stops | Medium | Graph | 7x | LC | ||
| 69 | All Nodes Distance K in Binary Tree | Medium | Hash Table, Tree, Depth-First Search | 7x | LC | ||
| 70 | Critical Connections in a Network | Hard | Depth-First Search, Graph Theory, Biconnected Component | 7x | LC | ||
| 71 | Regular Expression Matching | Hard | String, Dynamic Programming, Recursion | 6x | LC | ||
| 72 | First Missing Positive | Hard | Array, Hash Table | 6x | LC | ||
| 73 | Spiral Matrix | Medium | Array, Matrix, Simulation | 6x | LC | ||
| 74 | Word Search | Medium | Array, String, Backtracking | 6x | LC | ||
| 75 | Best Time to Buy and Sell Stock II | Medium | Other | 6x | LC | ||
| 76 | Copy List with Random Pointer | Medium | Hash Table, Linked List | 6x | LC | ||
| 77 | Design Add and Search Words Data Structure | Medium | String, Depth-First Search, Design | 6x | LC | ||
| 78 | Product of Array Except Self | Medium | Array / Two Pointers | 6x | LC | ||
| 79 | All O`one Data Structure | Hard | Hash Table, Linked List, Design | 6x | LC | ||
| 80 | Subarray Sum Equals K | Medium | Array, Hash Table, Prefix Sum | 6x | LC |
Graph (59 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Number of Islands | Medium | 20x | LC | |||
| 2 | Course Schedule II | Medium | Depth-First Search, Breadth-First Search, Graph Theory | 20x | LC | ||
| 3 | Course Schedule | Medium | Depth-First Search, Breadth-First Search, Graph Theory | 10x | LC | ||
| 4 | Reconstruct Itinerary | Hard | Array, String, Depth-First Search | 9x | LC | ||
| 5 | Network Delay Time | Medium | Depth-First Search, Breadth-First Search, Graph Theory | 9x | LC | ||
| 6 | Cheapest Flights Within K Stops | Medium | 7x | LC | |||
| 7 | Critical Connections in a Network | Hard | Depth-First Search, Graph Theory, Biconnected Component | 7x | LC | ||
| 8 | Bus Routes | Hard | 6x | LC | |||
| 9 | Graph Valid Tree | Medium | Depth-First Search, Breadth-First Search, Union-Find | 5x | LC | ||
| 10 | Number of Connected Components in an Undirected Graph | Medium | 5x | LC | |||
| 11 | Evaluate Division | Medium | 4x | LC | |||
| 12 | Clone Graph | Medium | Hash Table, Depth-First Search, Breadth-First Search | 3x | LC | ||
| 13 | Max Area of Island | Medium | Array, Depth-First Search, Breadth-First Search | 3x | LC | ||
| 14 | Making A Large Island | Hard | Array, Depth-First Search, Breadth-First Search | 3x | LC | ||
| 15 | Is Graph Bipartite? | Medium | Depth-First Search, Breadth-First Search, Union-Find | 2x | LC | ||
| 16 | Lexicographically Smallest Permutation Greater Than Tar | Medium | Hash Table, String, Greedy | 2x | LC | ||
| 17 | Lexicographically Smallest Negated Permutation that Sum | Medium | Array, Math, Two Pointers | 2x | LC | ||
| 18 | Maximum Subgraph Score in a Tree | Hard | Array, Dynamic Programming, Tree | 2x | LC | ||
| 19 | Lexicographically Smallest Palindromic Permutation Grea | Hard | Two Pointers, String, Enumeration | 2x | LC | ||
| 20 | Course Schedule III | Hard | Array, Greedy, Sorting | 1x | LC | ||
| 21 | Minimum Number of Days to Disconnect Island | Hard | Array, Depth-First Search, Breadth-First Search | 1x | LC | ||
| 22 | Course Schedule IV | Medium | Depth-First Search, Breadth-First Search, Graph Theory | 1x | LC | ||
| 23 | The k-th Lexicographical String of All Happy Strings of | Medium | String, Backtracking | 1x | LC | ||
| 24 | Reachable Nodes In Subdivided Graph | Hard | 1x | LC | |||
| 25 | Lexicographically Smallest String After Deleting Duplic | Hard | Hash Table, String, Stack | 1x | LC | ||
| 26 | Count Routes to Climb a Rectangular Grid | Hard | Array, Dynamic Programming, Matrix | 1x | LC | ||
| 27 | Largest Color Value In A Directed Graph | ? | 1x | LC | |||
| 28 | Minimum Weighted Subgraph With The Required Paths | ? | 1x | LC | |||
| 29 | Lexicographical Numbers | Medium | Depth-First Search, Trie | LC | |||
| 30 | Island Perimeter | Easy | LC | ||||
| 31 | Number of Distinct Islands | Medium | Array, Hash Table, Depth-First Search | LC | |||
| 32 | Number of Distinct Islands II | Hard | Array, Hash Table, Depth-First Search | LC | |||
| 33 | Last Substring in Lexicographical Order | Hard | Two Pointers, String | LC | |||
| 34 | Number of Closed Islands | Medium | Array, Depth-First Search, Breadth-First Search | LC | |||
| 35 | Number of Operations to Make Network Connected | Medium | Depth-First Search, Breadth-First Search, Union-Find | LC | |||
| 36 | Reorder Routes to Make All Paths Lead to the City Zero | Medium | Depth-First Search, Breadth-First Search, Graph Theory | LC | |||
| 37 | Construct the Lexicographically Largest Valid Sequence | Medium | Array, Backtracking | LC | |||
| 38 | Minimum Degree of a Connected Trio in a Graph | Hard | LC | ||||
| 39 | Find Center of Star Graph | Easy | Graph Theory | LC | |||
| 40 | Count Sub Islands | Medium | Array, Depth-First Search, Breadth-First Search | LC | |||
| 41 | Find if Path Exists in Graph | Easy | Depth-First Search, Breadth-First Search, Union-Find | LC | |||
| 42 | Count Unreachable Pairs of Nodes in an Undirected Graph | Medium | LC | ||||
| 43 | Longest Cycle in a Graph | Hard | LC | ||||
| 44 | Using a Robot to Print the Lexicographically Smallest S | Medium | LC | ||||
| 45 | Maximum Star Sum of a Graph | Medium | LC | ||||
| 46 | Lexicographically Smallest Palindrome | Easy | LC | ||||
| 47 | Count Visited Nodes in a Directed Graph | Hard | LC | ||||
| 48 | Minimum Cost Walk in Weighted Graph | Hard | Array, Bit Manipulation, Union-Find | LC | |||
| 49 | Lexicographically Smallest String After Substring Opera | Medium | LC | ||||
| 50 | All Ancestors of a Node in a Directed Acyclic Graph | Medium | LC |
DP (30 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Jump Game II | Medium | Array, Dynamic Programming, Greedy | 11x | LC | ||
| 2 | Word Break | Medium | Array, Hash Table, String | 11x | LC | ||
| 3 | Longest Increasing Subsequence | Medium | 10x | LC | |||
| 4 | Word Break II | Hard | Array, Hash Table, String | 9x | LC | ||
| 5 | House Robber | Medium | Array, Dynamic Programming | 9x | LC | ||
| 6 | Maximum Profit in Job Scheduling | Hard | 9x | LC | |||
| 7 | Jump Game | Medium | Array, Dynamic Programming, Greedy | 7x | LC | ||
| 8 | Climbing Stairs | Easy | Math, Dynamic Programming, Memoization | 7x | LC | ||
| 9 | Decode Ways | Medium | 7x | LC | |||
| 10 | Coin Change | Medium | Array, Dynamic Programming, Breadth-First Search | 7x | LC | ||
| 11 | Regular Expression Matching | Hard | String, Dynamic Programming, Recursion | 6x | LC | ||
| 12 | Edit Distance | Medium | 5x | LC | |||
| 13 | House Robber II | Medium | 5x | LC | |||
| 14 | House Robber III | Medium | Dynamic Programming, Tree, Depth-First Search | 5x | LC | ||
| 15 | Minimum Path Sum | Medium | Array, Dynamic Programming, Matrix | 4x | LC | ||
| 16 | Unique Paths | Medium | Math, Dynamic Programming, Combinatorics | 3x | LC | ||
| 17 | Unique Paths II | Medium | Array, Dynamic Programming, Matrix | 2x | LC | ||
| 18 | Longest Increasing Path in a Matrix | Hard | Array, Dynamic Programming, Depth-First Search | 2x | LC | ||
| 19 | Unique Paths III | Hard | Array, Backtracking, Bit Manipulation | 2x | LC | ||
| 20 | Coin Change II | Medium | 1x | LC | |||
| 21 | Jump Game IV | Hard | Array, Hash Table, Breadth-First Search | 1x | LC | ||
| 22 | Jump Game III | Medium | 1x | LC | |||
| 23 | Decode Ways II | Hard | String, Dynamic Programming | 1x | LC | ||
| 24 | Coin Change 2 | ? | 1x | LC | |||
| 25 | Number of Longest Increasing Subsequence | Medium | Array, Dynamic Programming, Binary Indexed Tree | LC | |||
| 26 | Min Cost Climbing Stairs | Easy | LC | ||||
| 27 | Jump Game VIII | Medium | LC | ||||
| 28 | Jump Game VII | Medium | String, Dynamic Programming, Sliding Window | LC | |||
| 29 | House Robber IV | Medium | Array, Binary Search, Dynamic Programming | LC | |||
| 30 | Maximum Profit From Trading Stocks | Medium | LC |
Tree (206 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Binary Tree Maximum Path Sum | Hard | Dynamic Programming, Tree, Depth-First Search | 12x | LC | ||
| 2 | Serialize and Deserialize Binary Tree | Hard | String, Tree, Depth-First Search | 11x | LC | ||
| 3 | Longest Substring Without Repeating Characters | Medium | Hash Table, String, Sliding Window | 10x | LC | ||
| 4 | Minimum Window Substring | Hard | Hash Table, String, Sliding Window | 8x | LC | ||
| 5 | Validate Binary Search Tree | Medium | Tree, Depth-First Search, Binary Search Tree | 8x | LC | ||
| 6 | Implement Trie (Prefix Tree) | Medium | Hash Table, String, Design | 8x | LC | ||
| 7 | Lowest Common Ancestor of a Binary Tree | Medium | Tree, Depth-First Search, Binary Tree | 8x | LC | ||
| 8 | Construct Binary Tree from Preorder and Inorder Travers | Medium | Array, Hash Table, Divide and Conquer | 7x | LC | ||
| 9 | Kth Smallest Element in a BST | Medium | Tree, Depth-First Search, Binary Search Tree | 7x | LC | ||
| 10 | All Nodes Distance K in Binary Tree | Medium | Hash Table, Tree, Depth-First Search | 7x | LC | ||
| 11 | Longest Palindromic Substring | Medium | Two Pointers, String, Dynamic Programming | 5x | LC | ||
| 12 | Binary Tree Level Order Traversal | Medium | Tree, Breadth-First Search, Binary Tree | 5x | LC | ||
| 13 | Binary Tree Zigzag Level Order Traversal | Medium | Tree, Breadth-First Search, Binary Tree | 5x | LC | ||
| 14 | Maximum Depth of Binary Tree | Easy | Tree, Depth-First Search, Breadth-First Search | 5x | LC | ||
| 15 | Binary Tree Right Side View | Medium | Tree, Depth-First Search, Breadth-First Search | 5x | LC | ||
| 16 | Invert Binary Tree | Easy | Tree, Depth-First Search, Breadth-First Search | 5x | LC | ||
| 17 | Subtree of Another Tree | Easy | Tree, Depth-First Search, String Matching | 5x | LC | ||
| 18 | Amount of Time for Binary Tree to Be Infected | Medium | Hash Table, Tree, Depth-First Search | 5x | LC | ||
| 19 | Recover Binary Search Tree | Medium | Tree, Depth-First Search, Binary Search Tree | 4x | LC | ||
| 20 | Symmetric Tree | Easy | Tree, Depth-First Search, Breadth-First Search | 4x | LC | ||
| 21 | Lowest Common Ancestor of a Binary Search Tree | Medium | 4x | LC | |||
| 22 | Shortest Path in a Grid with Obstacles Elimination | Hard | Array, Breadth-First Search, Matrix | 4x | LC | ||
| 23 | Same Tree | Easy | 3x | LC | |||
| 24 | Convert Sorted Array to Binary Search Tree | Easy | 3x | LC | |||
| 25 | Flatten Binary Tree to Linked List | Medium | Linked List, Stack, Tree | 3x | LC | ||
| 26 | Count Complete Tree Nodes | Easy | 3x | LC | |||
| 27 | Closest Binary Search Tree Value II | Hard | Two Pointers, Stack, Tree | 3x | LC | ||
| 28 | Minimum Height Trees | Medium | Depth-First Search, Breadth-First Search, Graph Theory | 3x | LC | ||
| 29 | Diameter of Binary Tree | Easy | Tree, Depth-First Search, Binary Tree | 3x | LC | ||
| 30 | Boundary of Binary Tree | Medium | 3x | LC | |||
| 31 | Palindromic Substrings | Medium | Two Pointers, String, Dynamic Programming | 3x | LC | ||
| 32 | Binary Tree Cameras | Hard | 3x | LC | |||
| 33 | Maximum Sum BST in Binary Tree | Hard | Dynamic Programming, Tree, Depth-First Search | 3x | LC | ||
| 34 | Binary Tree Inorder Traversal | Easy | Stack, Tree, Depth-First Search | 2x | LC | ||
| 35 | Unique Binary Search Trees II | Medium | 2x | LC | |||
| 36 | Unique Binary Search Trees | Medium | Math, Dynamic Programming, Tree | 2x | LC | ||
| 37 | Construct Binary Tree from Inorder and Postorder Traver | Medium | 2x | LC | |||
| 38 | Binary Tree Postorder Traversal | Easy | Stack, Tree, Depth-First Search | 2x | LC | ||
| 39 | Binary Tree Paths | Easy | String, Backtracking, Tree | 2x | LC | ||
| 40 | Longest Substring with At Most K Distinct Characters | Medium | Hash Table, String, Sliding Window | 2x | LC | ||
| 41 | Delete Node in a BST | Medium | Tree, Binary Search Tree, Binary Tree | 2x | LC | ||
| 42 | Convert BST to Greater Tree | Medium | Tree, Depth-First Search, Binary Search Tree | 2x | LC | ||
| 43 | Maximum Width of Binary Tree | Medium | 2x | LC | |||
| 44 | Count Unique Characters of All Substrings of a Given St | Hard | Hash Table, String, Dynamic Programming | 2x | LC | ||
| 45 | Vertical Order Traversal of a Binary Tree | Hard | Hash Table, Tree, Depth-First Search | 2x | LC | ||
| 46 | Cousins in Binary Tree | Easy | 2x | LC | |||
| 47 | Longest Duplicate Substring | Hard | String, Binary Search, Sliding Window | 2x | LC | ||
| 48 | Count Good Nodes in Binary Tree | Medium | Tree, Depth-First Search, Breadth-First Search | 2x | LC | ||
| 49 | Lowest Common Ancestor of a Binary Tree III | Medium | Hash Table, Two Pointers, Tree | 2x | LC | ||
| 50 | Length of the Longest Valid Substring | Hard | 2x | LC |
Array / Two Pointers (101 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Trapping Rain Water | Hard | Array, Two Pointers, Dynamic Programming | 12x | LC | ||
| 2 | Maximum Subarray | Medium | Array, Divide and Conquer, Dynamic Programming | 9x | LC | ||
| 3 | Maximum Product Subarray | Medium | Array, Dynamic Programming | 9x | LC | ||
| 4 | Two Sum | Easy | Array, Hash Table | 8x | LC | ||
| 5 | Container With Most Water | Medium | Array, Two Pointers, Greedy | 8x | LC | ||
| 6 | Product of Array Except Self | Medium | 6x | LC | |||
| 7 | Subarray Sum Equals K | Medium | Array, Hash Table, Prefix Sum | 6x | LC | ||
| 8 | Trapping Rain Water II | Hard | Array, Breadth-First Search, Heap (Priority Queue) | 3x | LC | ||
| 9 | Maximum Subarray Sum with One Deletion | Medium | Array, Dynamic Programming | 3x | LC | ||
| 10 | Merge Sorted Array | Easy | 2x | LC | |||
| 11 | Continuous Subarray Sum | Medium | Array, Hash Table, Math | 2x | LC | ||
| 12 | Binary Subarrays With Sum | Medium | Array, Hash Table, Sliding Window | 2x | LC | ||
| 13 | Subarray Sums Divisible by K | Medium | 2x | LC | |||
| 14 | Subarrays with K Different Integers | Hard | Array, Hash Table, Sliding Window | 2x | LC | ||
| 15 | Count Number of Nice Subarrays | Medium | 2x | LC | |||
| 16 | XOR Queries of a Subarray | Medium | Array, Bit Manipulation, Prefix Sum | 2x | LC | ||
| 17 | Longest Continuous Subarray With Absolute Diff Less Tha | Medium | Array, Queue, Sliding Window | 2x | LC | ||
| 18 | Count Bowl Subarrays | Medium | Array, Stack, Monotonic Stack | 2x | LC | ||
| 19 | Stable Subarrays With Equal Boundary and Interior Sum | Medium | Array, Hash Table, Prefix Sum | 2x | LC | ||
| 20 | Longest Balanced Subarray II | Hard | Array, Hash Table, Divide and Conquer | 2x | LC | ||
| 21 | Minimum Inversion Count in Subarrays of Fixed Length | Hard | Array, Segment Tree, Sliding Window | 2x | LC | ||
| 22 | Minimum Operations to Equalize Subarrays | Hard | Array, Math, Binary Search | 2x | LC | ||
| 23 | Count Stable Subarrays | ? | 2x | LC | |||
| 24 | Longest Non-Decreasing Subarray After Replacing at Most | Medium | Array, Dynamic Programming | 2x | LC | ||
| 25 | Count Subarrays With Majority Element II | Hard | Array, Hash Table, Divide and Conquer | 2x | LC | ||
| 26 | Count Distinct Subarrays Divisible by K in Sorted Array | Hard | Array, Hash Table, Prefix Sum | 2x | LC | ||
| 27 | Maximum Total Subarray Value II | Hard | Array, Greedy, Segment Tree | 2x | LC | ||
| 28 | Two Sum II - Input Array Is Sorted | Medium | Array, Two Pointers, Binary Search | 1x | LC | ||
| 29 | Minimum Size Subarray Sum | Medium | 1x | LC | |||
| 30 | Maximum Size Subarray Sum Equals k | Medium | Array, Hash Table, Prefix Sum | 1x | LC | ||
| 31 | Shortest Subarray with Sum at Least K | Hard | Array, Binary Search, Queue | 1x | LC | ||
| 32 | Sum of Subarray Minimums | Medium | Array, Dynamic Programming, Stack | 1x | LC | ||
| 33 | Sum of All Odd Length Subarrays | Easy | 1x | LC | |||
| 34 | K Radius Subarray Averages | Medium | Array, Sliding Window | 1x | LC | ||
| 35 | Maximum Sum of 3 Non-Overlapping Subarrays | Hard | 1x | LC | |||
| 36 | Maximum Sum of Two Non-Overlapping Subarrays | Medium | Array, Dynamic Programming, Sliding Window | 1x | LC | ||
| 37 | Longest Alternating Subarray After Removing At Most One | Hard | Array, Dynamic Programming, Enumeration | 1x | LC | ||
| 38 | Minimum Cost to Merge Sorted Lists | Hard | Array, Two Pointers, Binary Search | 1x | LC | ||
| 39 | Maximum Alternating Subarray Sum | Medium | LC | ||||
| 40 | Shortest Unsorted Continuous Subarray | Medium | LC | ||||
| 41 | Maximum Average Subarray I | Easy | Array, Sliding Window | LC | |||
| 42 | Subarray Product Less Than K | Medium | Array, Binary Search, Sliding Window | LC | |||
| 43 | Maximum Length of Repeated Subarray | Medium | Array, Binary Search, Dynamic Programming | LC | |||
| 44 | Maximum Sum Circular Subarray | Medium | Array, Divide and Conquer, Dynamic Programming | LC | |||
| 45 | Number of Valid Subarrays | Hard | LC | ||||
| 46 | Two Sum Less Than K | Easy | LC | ||||
| 47 | Longest Subarray of 1's After Deleting One Element | Medium | Array, Dynamic Programming, Sliding Window | LC | |||
| 48 | Minimum Number of Increments on Subarrays to Form a Tar | Hard | Array, Dynamic Programming, Stack | LC | |||
| 49 | Shortest Subarray to be Removed to Make Array Sorted | Medium | LC | ||||
| 50 | Maximum Length of Subarray With Positive Product | Medium | LC |
Sliding Window (4 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Sliding Window Maximum | Hard | Array, Queue, Sliding Window | 8x | LC | ||
| 2 | Longest Repeating Character Replacement | Medium | Hash Table, String, Sliding Window | 3x | LC | ||
| 3 | Sliding Window Median | Hard | Array, Hash Table, Sliding Window | 3x | LC | ||
| 4 | Minimum Window Subsequence | ? | 2x | LC |
Intervals (18 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Merge Intervals | Medium | Array, Sorting | 14x | LC | ||
| 2 | Meeting Rooms II | Medium | Array, Two Pointers, Greedy | 12x | LC | ||
| 3 | Insert Interval | Medium | Array | 8x | LC | ||
| 4 | Non-overlapping Intervals | Medium | Array, Dynamic Programming, Greedy | 5x | LC | ||
| 5 | Meeting Rooms | Easy | Array, Sorting | 3x | LC | ||
| 6 | Meeting Rooms III | Hard | Array, Hash Table, Sorting | 3x | LC | ||
| 7 | My Calendar III | Hard | 2x | LC | |||
| 8 | My Calendar II | Medium | 1x | LC | |||
| 9 | Minimum Interval to Include Each Query | Hard | 1x | LC | |||
| 10 | Data Stream as Disjoint Intervals | Hard | 1x | LC | |||
| 11 | Remove Interval | ? | 1x | LC | |||
| 12 | Find Right Interval | Medium | LC | ||||
| 13 | My Calendar I | Medium | Array, Binary Search, Design | LC | |||
| 14 | Interval List Intersections | Medium | Array, Two Pointers, Sweep Line | LC | |||
| 15 | Remove Covered Intervals | Medium | LC | ||||
| 16 | Count Odd Numbers in an Interval Range | Easy | Math | LC | |||
| 17 | Divide Intervals Into Minimum Number of Groups | Medium | Array, Two Pointers, Greedy | LC | |||
| 18 | Maximum Score of Non-overlapping Intervals | Hard | LC |
Heap / PQ (8 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Merge k Sorted Lists | Hard | Linked List, Divide and Conquer, Heap (Priority Queue) | 14x | LC | ||
| 2 | Find Median from Data Stream | Hard | Two Pointers, Design, Sorting | 14x | LC | ||
| 3 | Task Scheduler | Medium | 11x | LC | |||
| 4 | Top K Frequent Elements | Medium | Array, Hash Table, Divide and Conquer | 9x | LC | ||
| 5 | Kth Largest Element in an Array | Medium | Array, Divide and Conquer, Sorting | 8x | LC | ||
| 6 | Top K Frequent Words | Medium | Array, Hash Table, String | 4x | LC | ||
| 7 | Kth Largest Element in a Stream | Easy | Tree, Design, Binary Search Tree | 1x | LC | ||
| 8 | Task Scheduler II | Medium | Array, Hash Table, Simulation | LC |
Stack / Queue (27 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Generate Parentheses | Medium | String, Dynamic Programming, Backtracking | 9x | LC | ||
| 2 | Valid Parentheses | Easy | String, Stack | 8x | LC | ||
| 3 | Min Stack | Medium | Stack, Design | 8x | LC | ||
| 4 | Largest Rectangle in Histogram | Hard | Array, Stack, Monotonic Stack | 5x | LC | ||
| 5 | Longest Valid Parentheses | Hard | String, Dynamic Programming, Stack | 4x | LC | ||
| 6 | Basic Calculator | Hard | Math, String, Stack | 4x | LC | ||
| 7 | Implement Stack using Queues | Easy | Stack, Design, Queue | 4x | LC | ||
| 8 | Remove Invalid Parentheses | Hard | String, Backtracking, Breadth-First Search | 4x | LC | ||
| 9 | Implement Queue using Stacks | Easy | Stack, Design, Queue | 3x | LC | ||
| 10 | Max Stack | Hard | Linked List, Stack, Design | 3x | LC | ||
| 11 | Daily Temperatures | Medium | Array, Stack, Monotonic Stack | 3x | LC | ||
| 12 | Basic Calculator II | Medium | Math, String, Stack | 2x | LC | ||
| 13 | Maximum Frequency Stack | Hard | Hash Table, Stack, Design | 2x | LC | ||
| 14 | Different Ways to Add Parentheses | Medium | Math, String, Dynamic Programming | 1x | LC | ||
| 15 | Basic Calculator III | Hard | Math, String, Stack | 1x | LC | ||
| 16 | Minimum Add to Make Parentheses Valid | Medium | String, Stack, Greedy | 1x | LC | ||
| 17 | Minimum Remove to Make Valid Parentheses | Medium | String, Stack | 1x | LC | ||
| 18 | Design a Stack With Increment Operation | Medium | Array, Stack, Design | 1x | LC | ||
| 19 | Minimum Insertions to Balance a Parentheses String | Medium | String, Stack, Greedy | 1x | LC | ||
| 20 | Delete Middle Element Of A Stack | ? | 1x | LC | |||
| 21 | Valid Parenthesis String | Medium | String, Dynamic Programming, Stack | LC | |||
| 22 | Validate Stack Sequences | Medium | Array, Stack, Simulation | LC | |||
| 23 | Remove Outermost Parentheses | Easy | LC | ||||
| 24 | Maximum Nesting Depth of the Parentheses | Easy | String, Stack | LC | |||
| 25 | Check if a Parentheses String Can Be Valid | Medium | String, Stack, Greedy | LC | |||
| 26 | Dinner Plate Stacks | Hard | LC | ||||
| 27 | Maximum Height by Stacking Cuboids | Hard | Array, Dynamic Programming, Sorting | LC |
HashMap / Design (7 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | LRU Cache | Medium | 16x | LC | |||
| 2 | Group Anagrams | Medium | Array, Hash Table, String | 11x | LC | ||
| 3 | Insert Delete GetRandom O(1) | Medium | Array, Hash Table, Math | 8x | LC | ||
| 4 | LFU Cache | Hard | Hash Table, Linked List, Design | 8x | LC | ||
| 5 | Insert Delete GetRandom O(1) - Duplicates allowed | Hard | Array, Hash Table, Math | 7x | LC | ||
| 6 | Design HashMap | Easy | Array, Hash Table, Linked List | 4x | LC | ||
| 7 | Design Hit Counter | Medium | Array, Binary Search, Design | 3x | LC |
Binary Search (4 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Search in Rotated Sorted Array | Medium | Array, Binary Search | 13x | LC | ||
| 2 | Find First and Last Position of Element in Sorted Array | Medium | Array, Binary Search | 3x | LC | ||
| 3 | Binary Search | Easy | Array, Binary Search | 2x | LC | ||
| 4 | Search in Rotated Sorted Array II | Medium | Array, Binary Search | LC |
String (37 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Valid Palindrome | Easy | Two Pointers, String | 4x | LC | ||
| 2 | Palindrome Linked List | Easy | Linked List, Two Pointers, Stack | 4x | LC | ||
| 3 | Palindrome Partitioning | Medium | String, Dynamic Programming, Backtracking | 2x | LC | ||
| 4 | Palindrome Partitioning II | Hard | String, Dynamic Programming | 2x | LC | ||
| 5 | Valid Anagram | Easy | Hash Table, String, Sorting | 2x | LC | ||
| 6 | Palindrome Pairs | Hard | Array, Hash Table, String | 2x | LC | ||
| 7 | Longest Palindromic Subsequence | Medium | String, Dynamic Programming | 2x | LC | ||
| 8 | Count Binary Palindromic Numbers | Hard | Math, Bit Manipulation | 2x | LC | ||
| 9 | String to Integer (atoi) | Medium | String | 1x | LC | ||
| 10 | Shortest Palindrome | Hard | String, Rolling Hash, String Matching | 1x | LC | ||
| 11 | Encode and Decode Strings | Medium | Array, String, Design | 1x | LC | ||
| 12 | Find All Anagrams in a String | Medium | Hash Table, String, Sliding Window | 1x | LC | ||
| 13 | Find the Closest Palindrome | Hard | Math, String | 1x | LC | ||
| 14 | Count Different Palindromic Subsequences | Hard | String, Dynamic Programming | 1x | LC | ||
| 15 | Minimum Insertion Steps to Make a String Palindrome | Hard | 1x | LC | |||
| 16 | Unique Length-3 Palindromic Subsequences | Medium | 1x | LC | |||
| 17 | Valid Palindrome III | Hard | 1x | LC | |||
| 18 | Count Palindromic Subsequences | Hard | String, Dynamic Programming | 1x | LC | ||
| 19 | Palindrome Removal | Hard | Array, Dynamic Programming | 1x | LC | ||
| 20 | Palindrome Partitioning III | Hard | String, Dynamic Programming | 1x | LC | ||
| 21 | Longest Chunked Palindrome Decomposition | ? | 1x | LC | |||
| 22 | Palindrome Number | Easy | Math | LC | |||
| 23 | Decode String | Medium | String, Stack, Recursion | LC | |||
| 24 | Longest Palindrome | Easy | Hash Table, String, Greedy | LC | |||
| 25 | Valid Palindrome II | Easy | Two Pointers, String, Greedy | LC | |||
| 26 | Find Resultant Array After Removing Anagrams | Easy | Array, Hash Table, String | LC | |||
| 27 | Remove Palindromic Subsequences | Easy | LC | ||||
| 28 | Minimum Number of Steps to Make Two Strings Anagram | Medium | LC | ||||
| 29 | Next Palindrome Using Same Digits | Hard | Two Pointers, String | LC | |||
| 30 | Valid Palindrome IV | Medium | Two Pointers, String | LC | |||
| 31 | Strictly Palindromic Number | Medium | LC | ||||
| 32 | Merge Operations to Turn Array Into a Palindrome | Medium | LC | ||||
| 33 | Prime Palindrome | Medium | Math, Number Theory | LC | |||
| 34 | Minimum Number of Moves to Make Palindrome | Hard | Two Pointers, String, Greedy | LC | |||
| 35 | Construct K Palindrome Strings | Medium | Hash Table, String, Greedy | LC | |||
| 36 | Find the Largest Palindrome Divisible by K | Hard | LC | ||||
| 37 | Smallest Palindromic Rearrangement I | Medium | LC |
Backtracking (33 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Next Permutation | Medium | Array, Two Pointers | 9x | LC | ||
| 2 | Word Search II | Hard | Array, String, Backtracking | 9x | LC | ||
| 3 | Word Search | Medium | Array, String, Backtracking | 6x | LC | ||
| 4 | Combination Sum | Medium | 5x | LC | |||
| 5 | Subsets | Medium | Array, Backtracking, Bit Manipulation | 5x | LC | ||
| 6 | Partition Equal Subset Sum | Medium | Array, Dynamic Programming | 5x | LC | ||
| 7 | Permutations | Medium | Array, Backtracking | 3x | LC | ||
| 8 | N-Queens | Hard | Array, Backtracking | 3x | LC | ||
| 9 | Letter Combinations of a Phone Number | Medium | Hash Table, String, Backtracking | 2x | LC | ||
| 10 | Combination Sum II | Medium | Array, Backtracking | 2x | LC | ||
| 11 | N-Queens II | Hard | Backtracking | 2x | LC | ||
| 12 | Permutation Sequence | Hard | Math, Recursion | 2x | LC | ||
| 13 | Combinations | Medium | Backtracking | 2x | LC | ||
| 14 | Combination Sum IV | Medium | Array, Dynamic Programming | 2x | LC | ||
| 15 | Permutations II | Medium | Array, Backtracking, Sorting | 1x | LC | ||
| 16 | Subsets II | Medium | Array, Backtracking, Bit Manipulation | 1x | LC | ||
| 17 | Combination Sum III | Medium | Array, Backtracking | 1x | LC | ||
| 18 | Largest Divisible Subset | Medium | Array, Math, Dynamic Programming | 1x | LC | ||
| 19 | Permutation in String | Medium | Hash Table, Two Pointers, String | 1x | LC | ||
| 20 | Partition to K Equal Sum Subsets | Medium | Array, Dynamic Programming, Backtracking | 1x | LC | ||
| 21 | Letter Case Permutation | Medium | String, Backtracking, Bit Manipulation | 1x | LC | ||
| 22 | Queries on a Permutation With Key | Medium | LC | ||||
| 23 | Decode XORed Permutation | Medium | LC | ||||
| 24 | Sum of All Subset XOR Totals | Easy | Array, Math, Backtracking | LC | |||
| 25 | Build Array from Permutation | Easy | Array, Simulation | LC | |||
| 26 | The Number of Beautiful Subsets | Medium | LC | ||||
| 27 | Count the Number of K-Free Subsets | Medium | LC | ||||
| 28 | Find the Maximum Number of Elements in Subset | Medium | LC | ||||
| 29 | Count Number of Maximum Bitwise-OR Subsets | Medium | LC | ||||
| 30 | Largest Combination With Bitwise AND Greater Than Zero | Medium | Array, Hash Table, Bit Manipulation | LC | |||
| 31 | Word Subsets | Medium | Array, Hash Table, String | LC | |||
| 32 | Maximum K to Sort a Permutation | Medium | LC | ||||
| 33 | Count the Number of Computer Unlocking Permutations | Medium | Array, Math, Brainteaser | LC |
Matrix / Grid (32 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Spiral Matrix | Medium | Array, Matrix, Simulation | 6x | LC | ||
| 2 | Kth Smallest Element in a Sorted Matrix | Medium | Array, Binary Search, Sorting | 5x | LC | ||
| 3 | Set Matrix Zeroes | Medium | 4x | LC | |||
| 4 | Rotate Image | Medium | Array, Math, Matrix | 2x | LC | ||
| 5 | Search a 2D Matrix II | Medium | Array, Binary Search, Divide and Conquer | 2x | LC | ||
| 6 | 01 Matrix | Medium | Array, Dynamic Programming, Breadth-First Search | 2x | LC | ||
| 7 | Shortest Path in Binary Matrix | Medium | Array, Breadth-First Search, Matrix | 2x | LC | ||
| 8 | Matrix Block Sum | Medium | Array, Matrix, Prefix Sum | 2x | LC | ||
| 9 | Search a 2D Matrix | Medium | Array, Binary Search, Matrix | 1x | LC | ||
| 10 | Find the Kth Smallest Sum of a Matrix With Sorted Rows | Hard | Array, Binary Search, Heap (Priority Queue) | 1x | LC | ||
| 11 | Minimum Cost Matrix Multiplication | ? | 1x | LC | |||
| 12 | Longest Line Of Consecutive One In Matrix | ? | 1x | LC | |||
| 13 | Spiral Matrix II | Medium | LC | ||||
| 14 | Score After Flipping Matrix | Medium | LC | ||||
| 15 | Transpose Matrix | Easy | Array, Matrix, Simulation | LC | |||
| 16 | Spiral Matrix III | Medium | Array, Matrix, Simulation | LC | |||
| 17 | Sort the Matrix Diagonally | Medium | LC | ||||
| 18 | The K Weakest Rows in a Matrix | Easy | Array, Binary Search, Sorting | LC | |||
| 19 | Count Negative Numbers in a Sorted Matrix | Easy | Array, Binary Search, Matrix | LC | |||
| 20 | Matrix Diagonal Sum | Easy | Array, Matrix | LC | |||
| 21 | Determine Whether Matrix Can Be Obtained By Rotation | Easy | Array, Matrix | LC | |||
| 22 | Minimum Operations to Remove Adjacent Ones in Matrix | Hard | LC | ||||
| 23 | Largest Local Values in a Matrix | Easy | Array, Matrix | LC | |||
| 24 | Reshape the Matrix | Easy | Array, Matrix, Simulation | LC | |||
| 25 | Maximum Matrix Sum | Medium | LC | ||||
| 26 | Check if Matrix Is X-Matrix | Easy | LC | ||||
| 27 | Sort Matrix by Diagonals | Medium | Array, Sorting, Matrix | LC | |||
| 28 | Paths in Matrix Whose Sum Is Divisible by K | Hard | LC | ||||
| 29 | Construct Product Matrix | Medium | LC | ||||
| 30 | Pyramid Transition Matrix | Medium | LC | ||||
| 31 | Lucky Numbers in a Matrix | Easy | LC | ||||
| 32 | Sparse Matrix Multiplication | Medium | Array, Hash Table, Matrix | LC |
Linked List (31 problems)
| # | Problem | Difficulty | Tags | Seen | LC | Editorial | Video |
|---|---|---|---|---|---|---|---|
| 1 | Add Two Numbers | Medium | Linked List, Math, Recursion | 7x | LC | ||
| 2 | Reverse Linked List | Easy | 7x | LC | |||
| 3 | Linked List Cycle | Easy | Hash Table, Linked List, Two Pointers | 5x | LC | ||
| 4 | Merge Two Sorted Lists | Easy | Linked List, Recursion | 4x | LC | ||
| 5 | Intersection of Two Linked Lists | Easy | Hash Table, Linked List, Two Pointers | 4x | LC | ||
| 6 | Linked List Cycle II | Medium | 3x | LC | |||
| 7 | Flatten a Multilevel Doubly Linked List | Medium | Linked List, Depth-First Search, Doubly-Linked List | 2x | LC | ||
| 8 | Design Linked List | Medium | Linked List, Design | 2x | LC | ||
| 9 | Middle of the Linked List | Easy | Linked List, Two Pointers | 2x | LC | ||
| 10 | Reverse Linked List II | Medium | Linked List | 1x | LC | ||
| 11 | Remove Linked List Elements | Easy | Linked List, Recursion | 1x | LC | ||
| 12 | Delete Node in a Linked List | Medium | Linked List | 1x | LC | ||
| 13 | Plus One Linked List | Medium | Linked List, Math | 1x | LC | ||
| 14 | Next Greater Node In Linked List | Medium | Array, Linked List, Stack | 1x | LC | ||
| 15 | Remove Zero Sum Consecutive Nodes from Linked List | Medium | Hash Table, Linked List | 1x | LC | ||
| 16 | Merge In Between Linked Lists | Medium | Linked List | 1x | LC | ||
| 17 | Odd Even Linked List | Medium | Linked List | LC | |||
| 18 | Add Two Numbers II | Medium | Linked List, Math, Stack | LC | |||
| 19 | Swapping Nodes in a Linked List | Medium | Linked List, Two Pointers | LC | |||
| 20 | Split Linked List in Parts | Medium | Linked List | LC | |||
| 21 | Linked List Components | Medium | Array, Hash Table, Linked List | LC | |||
| 22 | Insert into a Sorted Circular Linked List | Medium | Linked List | LC | |||
| 23 | Convert Binary Number in a Linked List to Integer | Easy | LC | ||||
| 24 | Add Two Polynomials Represented as Linked Lists | Medium | LC | ||||
| 25 | Delete the Middle Node of a Linked List | Medium | Linked List, Two Pointers | LC | |||
| 26 | Maximum Twin Sum of a Linked List | Medium | LC | ||||
| 27 | Remove Nodes From Linked List | Medium | Linked List, Stack, Recursion | LC | |||
| 28 | Double a Number Represented as a Linked List | Medium | Linked List, Math, Stack | LC | |||
| 29 | Delete Nodes From Linked List Present in Array | Medium | Array, Hash Table, Linked List | LC | |||
| 30 | Insert Greatest Common Divisors in Linked List | Medium | Linked List, Math, Number Theory | LC | |||
| 31 | Remove Duplicates From an Unsorted Linked List | Medium | Hash Table, Linked List | LC |