| 1 | Majority Element: Find the Value That Fills More Than Half the ArrayEasy | Arrays | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 2 | Find Pivot Index: Balance Left and Right Prefix SumsEasy | Arrays | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 3 | Product of Array Except Self: Prefix and Suffix Products Without DivisionMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 4 | Subarray Sum Equals K: Count Contiguous Slices With a Given SumMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 5 | Subarray Sums Divisible by K: Count Matching Prefix RemaindersMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 6 | Contiguous Array: Longest Balanced 0/1 Subarray via Prefix SumsMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 7 | Shortest Subarray with Sum at Least K: Prefix Sums and a Monotonic DequeHard | Arrays | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 8 | Maximum Subarray: Largest Sum of a Contiguous Slice with Kadane's AlgorithmMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 9 | Maximum Product Subarray: Track Both the Largest and Smallest ProductMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 10 | Maximum Subarray Sum with One Deletion: Kadane With Two StatesMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 11 | Maximum Absolute Sum of Any Subarray: Run Kadane for Max and MinMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 12 | Maximum Sum Circular Subarray: Kadane Plus Total Minus MinimumMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 13 | Rotate Image: Turn a Square Matrix 90 Degrees Clockwise in PlaceMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 14 | Spiral Matrix: Read a Grid in Clockwise Spiral OrderMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 15 | Set Matrix Zeroes: Zero Out Rows and Columns in PlaceMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 16 | Missing Number: Find the One Value Absent From 0 to nEasy | Arrays | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 17 | Find All Numbers Disappeared in an Array: Cyclic Sort and In-Place MarkingEasy | Arrays | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 18 | Set Mismatch: Find the Duplicate and the Missing Number With Cyclic SortEasy | Arrays | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 19 | Find All Duplicates in an Array: Cyclic Sort and Sign Marking in O(1) SpaceMedium | Arrays | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 20 | First Missing Positive: Cyclic Sort Into Home Slots in O(n) Time, O(1) SpaceHard | Arrays | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 21 | Contains Duplicate: Detect Whether Any Value Appears TwiceEasy | Hashing | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 22 | Valid Anagram: Check Whether Two Strings Use the Same LettersEasy | Hashing | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 23 | Two Sum: Find Two Indices That Add Up to a TargetEasy | Hashing | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 24 | First Unique Character in a String: Count, Then Scan AgainEasy | Hashing | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 25 | Longest Palindrome: Pair Up Letter Counts and Keep One CentreEasy | Hashing | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 26 | Ransom Note: Check Letter Supply Against Demand With a CounterEasy | Hashing | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 27 | Valid Sudoku: Check Rows, Columns and Boxes for Repeated DigitsMedium | Hashing | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 28 | Group Anagrams: Bucket Words That Share the Same LettersMedium | Hashing | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 29 | Longest Consecutive Sequence: Longest Run of Consecutive Integers in O(n)Medium | Hashing | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 30 | Longest Common Prefix: Shared Start of a List of StringsEasy | Strings | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 31 | Reverse String: Reverse a Character Array in PlaceEasy | Strings | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 32 | Encode and Decode Strings: Serialise a List of Strings SafelyMedium | Strings | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 33 | String to Integer (atoi): Parse a Signed 32-bit Integer by HandMedium | Strings | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 34 | Number of 1 Bits: Count Set Bits in an IntegerEasy | Bit Manipulation | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 35 | Reverse Bits: Mirror the 32 Bits of an Unsigned IntegerEasy | Bit Manipulation | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 36 | Single Number: Find the Value That Appears Only Once Using XOREasy | Bit Manipulation | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 37 | Counting Bits: Set-Bit Counts for 0 to n with a One-Line DPEasy | Bit Manipulation | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 38 | Complement of Base 10 Integer: Flip Bits With an All-Ones MaskEasy | Bit Manipulation | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 39 | Sum of Two Integers: Add Without the Plus or Minus OperatorMedium | Bit Manipulation | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 40 | Single Number III: Split Two Unique Values With One XOR BitMedium | Bit Manipulation | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 41 | Valid Palindrome II: Palindrome After Deleting at Most One CharacterEasy | Two Pointers | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 42 | Valid Palindrome: Check a Phrase While Ignoring Case and PunctuationEasy | Two Pointers | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 43 | Move Zeroes: Shift Zeros to the End While Keeping OrderEasy | Two Pointers | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 44 | Remove Duplicates from Sorted Array: Compact Unique Values In PlaceEasy | Two Pointers | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 45 | Squares of a Sorted Array: Merge From Both Ends Without SortingEasy | Two Pointers | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 46 | Segregate 0s and 1s: Partition a Binary Array in One PassEasy | Two Pointers | Easy | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 47 | Backspace String Compare: Read Both Strings Backwards With Skip CountersEasy | Two Pointers | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 48 | Two Sum II: Find a Pair With a Target Sum in a Sorted ArrayMedium | Two Pointers | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 49 | 3Sum: Find All Unique Triplets That Sum to ZeroMedium | Two Pointers | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 50 | Container With Most Water: Maximise Area Between Two LinesMedium | Two Pointers | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 51 | Sort Colors: One-Pass Three-Way Partition of 0s, 1s and 2sMedium | Two Pointers | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 52 | 3Sum Closest: Sort, Fix One Value, and Squeeze Two PointersMedium | Two Pointers | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 53 | Triplets with Smaller Sum: Count Many Pairs at Once With Two PointersMedium | Two Pointers | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 54 | Subarray Product Less Than K: Count Windows Ending at Each IndexMedium | Two Pointers | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 55 | 4Sum: Two Fixed Indices, Two Pointers and Careful Duplicate SkippingMedium | Two Pointers | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 56 | Shortest Unsorted Continuous Subarray: Find the Boundaries With Running Max and MinMedium | Two Pointers | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 57 | Trapping Rain Water: Total Water Held Between Elevation BarsHard | Two Pointers | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 58 | Implement Stack using Queues: LIFO Behaviour From FIFO PartsEasy | Queue | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 59 | Implement Queue using Stacks: FIFO With Two Stacks in Amortised O(1)Easy | Queue | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 60 | Number of Recent Calls: Count Requests in a Sliding Time WindowEasy | Queue | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 61 | Design Circular Queue: A Fixed-Capacity Ring BufferMedium | Queue | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 62 | Best Time to Buy and Sell Stock: Maximum Profit From One TradeEasy | Sliding Window | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 63 | Maximum Average Subarray I: Best Average Over a Fixed-Length WindowEasy | Sliding Window | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 64 | Max Sum Subarray of Size K: The Fixed-Size Sliding WindowEasy | Sliding Window | Easy | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 65 | Longest Substring Without Repeating Characters: Sliding WindowMedium | Sliding Window | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 66 | Longest Repeating Character Replacement: Window With At Most k ChangesMedium | Sliding Window | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 67 | Permutation in String: Does One String Contain a Rearrangement of Another?Medium | Sliding Window | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 68 | Minimum Size Subarray Sum: Grow Until Valid, Then ShrinkMedium | Sliding Window | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 69 | Longest K Unique Characters Substring: A Window Bounded by a Distinct CountMedium | Sliding Window | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 70 | Fruit Into Baskets: Longest Window With at Most Two Distinct ValuesMedium | Sliding Window | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 71 | Max Consecutive Ones III: Longest Window With at Most K ZerosMedium | Sliding Window | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 72 | Find All Anagrams in a String: Fixed Window With Letter CountsMedium | Sliding Window | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 73 | Minimum Window Substring: Shortest Slice Containing Every Required CharacterHard | Sliding Window | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 74 | Sliding Window Maximum: Max of Every Window With a Monotonic DequeHard | Sliding Window | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 75 | Substring with Concatenation of All Words: Word-Sized Sliding Windows per OffsetHard | Sliding Window | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 76 | Valid Parentheses: Check That Every Bracket Closes in the Right OrderEasy | Stack | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 77 | Remove All Adjacent Duplicates In String: Cancel Pairs With a StackEasy | Stack | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 78 | Min Stack: A Stack That Returns Its Minimum in Constant TimeMedium | Stack | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 79 | Evaluate Reverse Polish Notation: Compute a Postfix ExpressionMedium | Stack | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 80 | Remove All Adjacent Duplicates in String II: Stack of Character CountsMedium | Stack | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 81 | Simplify Path: Canonical Unix Paths With a Stack of Directory NamesMedium | Stack | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 82 | Next Greater Element I: First Larger Value to the RightEasy | Stack | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 83 | Daily Temperatures: Days Until a Warmer Day With a Monotonic StackMedium | Stack | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 84 | Car Fleet: Count the Groups of Cars Arriving at a DestinationMedium | Stack | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 85 | Next Greater Element II: Monotonic Stack Over a Circular ArrayMedium | Stack | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 86 | Remove Nodes From Linked List: Keep Nodes With Nothing Larger to Their RightMedium | Stack | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 87 | Remove K Digits: Smallest Number With a Greedy Monotonic StackMedium | Stack | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 88 | 132 Pattern: Find a Low, High, Middle Subsequence in One PassMedium | Stack | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 89 | Largest Rectangle in Histogram: Biggest Area Under the BarsHard | Stack | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 90 | Binary Search: Find a Target in a Sorted Array in O(log n)Easy | Binary Search | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 91 | Ceil in Sorted Array: Lower-Bound Binary SearchEasy | Binary Search | Easy | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 92 | Time Based Key-Value Store: Versioned Lookups with Binary SearchMedium | Binary Search | Medium | coding, architecture | LeetCode ↗ (opens in a new tab) | |
| 93 | Find First and Last Position of a Value: Lower and Upper Bound Binary SearchMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 94 | Number of Occurrence: Count a Value with Two Boundary SearchesMedium | Binary Search | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 95 | Median of Two Sorted Arrays: Partition Binary Search in O(log min(m, n))Hard | Binary Search | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 96 | Find Rotation Count: The Index of the Minimum Is the AnswerEasy | Binary Search | Easy | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 97 | Find Minimum in Rotated Sorted Array: Binary Search Against the Right EndMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 98 | Search in Rotated Sorted Array: One-Pass Binary SearchMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 99 | Peak Index in a Mountain Array: Binary Search on the SlopeMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 100 | Find Peak Element: Follow the Uphill Side with Binary SearchMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 101 | Koko Eating Bananas: Binary Search on the AnswerMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 102 | Minimum Number of Days to Make m Bouquets: Binary Search on the DayMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 103 | Aggressive Cows: Maximise the Minimum Gap with Binary SearchMedium | Binary Search | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 104 | Maximum Candies Allocated to K Children: Binary Search on the ShareMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 105 | Capacity To Ship Packages Within D Days: Binary Search on CapacityMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 106 | Split Array Largest Sum: Binary Search on the Largest PartHard | Binary Search | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 107 | Search a 2D Matrix: Binary Search over a Flattened Sorted GridMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 108 | Search a 2D Matrix II: Staircase Search from the Top-Right CornerMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 109 | Kth Smallest Element in a Sorted Matrix: Binary Search on ValuesMedium | Binary Search | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 110 | Merge Two Sorted Lists: Dummy Head Iteration and RecursionEasy | Linked List | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 111 | Remove Nth Node From End of List: One Pass with a Gap of nMedium | Linked List | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 112 | Copy List with Random Pointer: Hash Map and Interleaving SolutionsMedium | Linked List | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 113 | Add Two Numbers: Digit-by-Digit Addition on Linked ListsMedium | Linked List | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 114 | LRU Cache: Hash Map Plus Doubly Linked List for O(1) OperationsMedium | Linked List | Medium | coding, architecture | LeetCode ↗ (opens in a new tab) | |
| 115 | Linked List Cycle: Floyd's Fast and Slow PointersEasy | Linked List | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 116 | Happy Number: Detect a Cycle in a Digit-Square SequenceEasy | Linked List | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 117 | Middle of the Linked List: Find It in One Pass With Fast and Slow PointersEasy | Linked List | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 118 | Palindrome Linked List: Find the Middle, Reverse the Back Half, CompareEasy | Linked List | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 119 | Reorder List: Find the Middle, Reverse, Then InterleaveMedium | Linked List | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 120 | Find the Duplicate Number: Cycle Detection on an ArrayMedium | Linked List | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 121 | Linked List Cycle II: Find Where the Cycle Starts With Floyd's AlgorithmMedium | Linked List | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 122 | Circular Array Loop: Fast and Slow Pointers on Index JumpsMedium | Linked List | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 123 | Reverse Linked List: Iterative and Recursive SolutionsEasy | Linked List | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 124 | Reverse Linked List II: Reverse a Sublist in One Pass With a Dummy NodeMedium | Linked List | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 125 | Swap Nodes in Pairs: Rewire Every Two Nodes With a Dummy HeadMedium | Linked List | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 126 | Rotate List: Close the Ring, Then Cut It at the New TailMedium | Linked List | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 127 | Reverse Nodes in k-Group: In-Place Group Reversal on a Linked ListHard | Linked List | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 128 | Invert Binary Tree: Recursive and Iterative Mirror SolutionsEasy | Trees | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 129 | Maximum Depth of Binary Tree: Recursive DFS, Iterative DFS and BFSEasy | Trees | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 130 | Diameter of Binary Tree: Longest Path via Post-Order HeightsEasy | Trees | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 131 | Balanced Binary Tree: Height Check with Early ExitEasy | Trees | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 132 | Same Tree: Comparing Two Binary Trees Recursively and IterativelyEasy | Trees | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 133 | Subtree of Another Tree: Brute-Force Matching and Linear SerialisationEasy | Trees | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 134 | Count Good Nodes in Binary Tree: DFS Carrying the Path MaximumMedium | Trees | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 135 | Construct Binary Tree from Preorder and Inorder TraversalMedium | Trees | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 136 | Lowest Common Ancestor of a Binary Tree: One Post-Order SearchMedium | Trees | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 137 | Binary Tree Maximum Path Sum: Post-Order Gains with a Global BestHard | Trees | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 138 | Serialize and Deserialize Binary Tree: Preorder with Null MarkersHard | Trees | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 139 | Binary Tree Level Order Traversal: BFS with a Queue, Level by LevelMedium | Trees | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 140 | Binary Tree Right Side View: Last Node of Each LevelMedium | Trees | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 141 | Implement Trie (Prefix Tree): Insert, Search and Prefix LookupMedium | Trees | Medium | coding, architecture | LeetCode ↗ (opens in a new tab) | |
| 142 | Design Add and Search Words: Trie Search with WildcardsMedium | Trees | Medium | coding, architecture | LeetCode ↗ (opens in a new tab) | |
| 143 | Extra Characters in a String: Dynamic Programming over a Trie of WordsMedium | Trees | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 144 | Search Suggestions System: Autocomplete with a Trie or Sorted Binary SearchMedium | Trees | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 145 | Word Search II: Find Many Words in a Grid with a Trie and BacktrackingHard | Trees | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 146 | Convert Sorted Array to BST: Pick the Middle, Recurse on HalvesEasy | BST | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 147 | Validate Binary Search Tree: Bounds Recursion and Inorder CheckMedium | BST | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 148 | Kth Smallest Element in a BST: Inorder Traversal with Early StopMedium | BST | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 149 | Lowest Common Ancestor of a BST: Follow the Split PointMedium | BST | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 150 | Insert into a BST: Walk Down to the Empty SpotMedium | BST | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 151 | Delete Node in a BST: Leaf, One Child and Two Children CasesMedium | BST | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 152 | Kth Largest Element in a Stream: Size-k Min-HeapEasy | Heap | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 153 | Last Stone Weight: Simulating Smashes with a Max-HeapEasy | Heap | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 154 | Top K Frequent Elements: Return the k Most Common ValuesMedium | Heap | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 155 | K Closest Points to Origin: Bounded Max-Heap and QuickselectMedium | Heap | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 156 | Kth Largest Element in an Array: Heap, Quickselect and CountingMedium | Heap | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 157 | Task Scheduler: Cooldowns with a Max-Heap or a Counting FormulaMedium | Heap | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 158 | Min Cost to Connect Ropes: Always Join the Two ShortestMedium | Heap | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 159 | Sort Characters By Frequency: Count, Then Order by a Heap or BucketsMedium | Heap | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 160 | Find K Closest Elements: Binary Search for the Best WindowMedium | Heap | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 161 | Reorganize String: Place the Most Frequent Character First, Never Twice in a RowMedium | Heap | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 162 | Maximum Frequency Stack: Pop the Most Frequent Value in O(1)Hard | Heap | Hard | coding, architecture | LeetCode ↗ (opens in a new tab) | |
| 163 | Maximum Sum Combination: The K Largest Pair Sums with a Max-HeapMedium | Heap | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 164 | Find Median from Data Stream: Two Heaps Kept in BalanceHard | Heap | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 165 | Sliding Window Median: Two Heaps with Lazy DeletionHard | Heap | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 166 | IPO: Maximise Capital by Picking the Best Affordable Project Each RoundHard | Heap | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 167 | Design Twitter: News Feed with a K-Way Heap MergeMedium | Heap | Medium | coding, architecture | LeetCode ↗ (opens in a new tab) | |
| 168 | Merge k Sorted Lists: Min-Heap and Divide-and-Conquer SolutionsHard | Heap | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 169 | Smallest Range Covering Elements from K Lists: K-Way Merge with a Min-HeapHard | Heap | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 170 | Jump Game: Can You Reach the Last Index? Greedy Furthest ReachMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 171 | Jump Game II: Fewest Jumps to the End with Greedy Level-by-Level BFSMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 172 | Gas Station: Find the Start of a Circular Route in One Greedy PassMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 173 | Hand of Straights: Group Cards into Consecutive Runs GreedilyMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 174 | Merge Triplets to Form Target: Keep Only Triplets That Never OvershootMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 175 | Partition Labels: Split a String So Each Letter Stays in One PartMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 176 | Valid Parenthesis String: Track a Range of Open Counts GreedilyMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 177 | Maximum Length of Pair Chain: Greedy by Earliest EndMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 178 | Minimum Add to Make Parentheses Valid: Count Unmatched Brackets in One PassMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 179 | Remove Duplicate Letters: Smallest Order with a Greedy Monotonic StackMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 180 | Meeting Rooms: Check Whether One Person Can Attend Every MeetingEasy | Greedy | Easy | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 181 | Merge Intervals: Combine Every Overlapping RangeMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 182 | Insert Interval: Add a Range to a Sorted List and Merge OverlapsMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 183 | Non-overlapping Intervals: Fewest Removals to Eliminate OverlapsMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 184 | Interval List Intersections: Two Pointers over Sorted RangesMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 185 | Meeting Rooms II: Count the Rooms with a Min-Heap or a Sweep LineMedium | Greedy | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 186 | My Calendar I: Accept Bookings Only When They Do Not OverlapMedium | Greedy | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 187 | Generate Parentheses: List Every Balanced String of n PairsMedium | Backtracking | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 188 | Subsets: Generate the Power Set with Include/Exclude BacktrackingMedium | Backtracking | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 189 | Permutations: Every Ordering of Distinct Values with BacktrackingMedium | Backtracking | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 190 | Subsets II: Power Set Without Duplicates When Values RepeatMedium | Backtracking | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 191 | Letter Combinations of a Phone Number: Cartesian Product by BacktrackingMedium | Backtracking | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 192 | Letter Case Permutation: Branch Twice on Every LetterMedium | Backtracking | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 193 | Combination Sum: Reach a Target with Reusable Values via BacktrackingMedium | Backtracking | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 194 | Combination Sum II: Use Each Value Once and Avoid Duplicate AnswersMedium | Backtracking | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 195 | Word Search: Trace a Word Through a Letter Grid with DFS BacktrackingMedium | Backtracking | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 196 | Palindrome Partitioning: Split a String into Palindromes by BacktrackingMedium | Backtracking | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 197 | N-Queens: Place Non-Attacking Queens Row by Row with BacktrackingHard | Backtracking | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 198 | Sudoku Solver: Backtracking with Constraint Sets and Smart Cell ChoiceHard | Backtracking | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 199 | Find if Path Exists in Graph: Reachability with BFS or Union-FindEasy | Graph | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 200 | Clone Graph: Deep-Copy a Connected Graph with a Hash Map and BFS or DFSMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 201 | Number of Provinces: Count Components in an Adjacency MatrixMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 202 | Word Ladder: Shortest Word Transformation with BFS and Wildcard BucketsHard | Graph | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 203 | Reconstruct Itinerary: Eulerian Path with Hierholzer's AlgorithmHard | Graph | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 204 | Flood Fill: Repaint a Connected Region with DFS or BFSEasy | Graph | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 205 | Island Perimeter: Count Land Edges Without a TraversalEasy | Graph | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 206 | Number of Islands: Count Connected Land Cells with BFS, DFS or Union-FindMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 207 | Max Area of Island: Largest Connected Land Region with Flood FillMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 208 | Pacific Atlantic Water Flow: Reverse Multi-Source BFS from Both OceansMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 209 | Surrounded Regions: Capture Enclosed Cells by Flood-Filling from the BorderMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 210 | Rotting Oranges: Minutes to Spread via Level-by-Level Multi-Source BFSMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 211 | Number of Closed Islands: Sink the Border, Then CountMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 212 | Course Schedule: Detect a Cycle in a Prerequisite Graph with Kahn's AlgorithmMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 213 | Course Schedule II: Return a Valid Course Order with Topological SortMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 214 | Topological Sort: Order a DAG with Kahn's Algorithm or DFSMedium | Graph | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 215 | Minimum Height Trees: Trim Leaves Until the Centre RemainsMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 216 | Alien Dictionary: Derive a Letter Order from Sorted Words with Topological SortHard | Graph | Hard | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 217 | Graph Valid Tree: Check Edge Count, Connectivity and Cycles with Union-FindMedium | Graph | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 218 | Number of Connected Components in an Undirected Graph with Union-FindMedium | Graph | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 219 | Redundant Connection: Find the Edge That Closes a Cycle with Union-FindMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 220 | Is Graph Bipartite?: Two-Colour Every ComponentMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 221 | Path With Minimum Effort: Minimise the Largest Step on a GridMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 222 | Network Delay Time: Single-Source Shortest Paths with Dijkstra's AlgorithmMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 223 | Cheapest Flights Within K Stops: Bounded Bellman-Ford for Limited HopsMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 224 | Min Cost to Connect All Points: Minimum Spanning Tree with Prim or KruskalMedium | Graph | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 225 | Swim in Rising Water: Minimax Path with a Modified DijkstraHard | Graph | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 226 | Climbing Stairs: Count Ways with a Fibonacci-Style DPEasy | Dynamic Programming | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 227 | Min Cost Climbing Stairs: Cheapest Path to the Top with 1D DPEasy | Dynamic Programming | Easy | coding | LeetCode ↗ (opens in a new tab) | |
| 228 | House Robber: Maximum Non-Adjacent Sum with Take-or-Skip DPMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 229 | House Robber II: Non-Adjacent Maximum Sum When Houses Form a CircleMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 230 | Decode Ways: Count Digit-to-Letter Decodings with Prefix DPMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 231 | Coin Change: Fewest Coins with Bottom-Up DPMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 232 | Word Break: Can a String Be Split into Dictionary Words? Prefix DPMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 233 | Longest Increasing Subsequence: O(n^2) DP and O(n log n) Patience SortingMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 234 | Best Time to Buy and Sell Stock with Cooldown: State-Machine DPMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 235 | Partition Equal Subset Sum: 0/1 Knapsack on Half the TotalMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 236 | Coin Change II: Count Combinations That Make an AmountMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 237 | Target Sum: Count Sign Assignments with Subset-Sum DPMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 238 | 0 - 1 Knapsack Problem: Take or Skip Each Item OnceMedium | Dynamic Programming | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 239 | Subset Sum Problem: Track Every Reachable TotalMedium | Dynamic Programming | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 240 | Count Subsets with Sum: Add Up the Ways, Not Just True or FalseMedium | Dynamic Programming | Medium | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 241 | Partition Into 2 Subsets with Min Sum Diff: Subset Sum Up to Half the TotalHard | Dynamic Programming | Hard | coding | GeeksforGeeks ↗ (opens in a new tab) | |
| 242 | Longest Palindromic Substring: Expand Around Centres or Interval DPMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 243 | Palindromic Substrings: Count Every Palindrome by Expanding Around CentresMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 244 | Unique Paths: Count Grid Routes with 2D DP or a Binomial CoefficientMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 245 | Longest Common Subsequence: The Classic Two-String DP TableMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 246 | Interleaving String: Can Two Strings Merge into a Third? 2D DPMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 247 | Edit Distance: Levenshtein Distance with a 2D DP TableMedium | Dynamic Programming | Medium | coding | LeetCode ↗ (opens in a new tab) | |
| 248 | Burst Balloons: Interval DP by Choosing the Last Balloon to BurstHard | Dynamic Programming | Hard | coding | LeetCode ↗ (opens in a new tab) | |
| 249 | Regular Expression Matching: Dot and Star with a 2D DP TableHard | Dynamic Programming | Hard | coding | LeetCode ↗ (opens in a new tab) | |