Skip to content

LeetCode

LeetCode practice notes exported from ChatGPT lessons.

Practice notes grouped by problem number.

Problems

#TitleDifficultyDescription
1LeetCode 1: Two SumEasyA clear explanation of the Two Sum problem using brute force first, then an optimized hash map solution.
2LeetCode 2: Add Two NumbersMediumA detailed explanation of the Add Two Numbers linked list problem, including digit-by-digit addition, carry handling, and linked list construction.
3LeetCode 3: Longest Substring Without Repeating CharactersMediumA clear explanation of the longest substring problem using sliding window and a hash set.
4LeetCode 4: Median of Two Sorted ArraysHardA detailed explanation of finding the median of two sorted arrays using binary search over partitions.
5LeetCode 5: Longest Palindromic SubstringMediumA detailed explanation of finding the longest palindromic substring using expand-around-center.
6LeetCode 6: Zigzag ConversionMediumA detailed explanation of converting a string into a zigzag pattern using row simulation.
7LeetCode 7: Reverse IntegerMediumA detailed explanation of reversing a signed 32-bit integer while handling overflow correctly.
8LeetCode 8: String to Integer (atoi)MediumA detailed explanation of parsing a string into a 32-bit signed integer with whitespace, sign, digit reading, and clamping rules.
9LeetCode 9: Palindrome NumberEasyA detailed explanation of checking whether an integer is a palindrome using digit operations without converting it to a string.
10LeetCode 10: Regular Expression MatchingHardA detailed explanation of matching a full string against a simplified regular expression with dot and star using dynamic programming.
11LeetCode 11: Container With Most WaterMediumA detailed explanation of finding the maximum water container area using two pointers.
12LeetCode 12: Integer to RomanMediumA detailed explanation of converting an integer into a Roman numeral using a fixed value-symbol table and greedy subtraction.
13LeetCode 13: Roman to IntegerEasyA detailed explanation of converting a Roman numeral string into an integer using symbol values and the subtraction rule.
14LeetCode 14: Longest Common PrefixEasyA detailed explanation of finding the longest common prefix among an array of strings by comparing characters column by column.
15LeetCode 15: 3SumMediumA detailed explanation of finding all unique triplets that sum to zero using sorting and two pointers.
16LeetCode 16: 3Sum ClosestMediumA detailed explanation of finding the sum of three integers closest to a target using sorting and two pointers.
17LeetCode 17: Letter Combinations of a Phone NumberMediumA detailed explanation of generating all possible phone keypad letter combinations using backtracking.
18LeetCode 18: 4SumMediumA detailed explanation of finding all unique quadruplets that sum to a target using sorting and two pointers.
19LeetCode 19: Remove Nth Node From End of ListMediumA detailed explanation of removing the nth node from the end of a singly linked list using two pointers and a dummy node.
20LeetCode 20: Valid ParenthesesEasyA detailed explanation of checking whether a bracket string is valid using a stack.
21LeetCode 21: Merge Two Sorted ListsEasyA detailed explanation of merging two sorted linked lists using a dummy node and pointer splicing.
22LeetCode 22: Generate ParenthesesMediumA detailed explanation of generating all well-formed parentheses strings using backtracking.
23LeetCode 23: Merge k Sorted ListsHardA detailed explanation of merging k sorted linked lists using a min heap.
24LeetCode 24: Swap Nodes in PairsMediumA detailed explanation of swapping every two adjacent nodes in a linked list using pointer manipulation.
25LeetCode 25: Reverse Nodes in k-GroupHardA detailed explanation of reversing linked-list nodes in groups of k using pointer manipulation and constant extra space.
26LeetCode 26: Remove Duplicates from Sorted ArrayEasyA clear explanation of removing duplicates from a sorted array in place using two pointers.
27LeetCode 27: Remove ElementEasyA clear explanation of removing all occurrences of a value from an array in place using a write pointer.
28LeetCode 28: Find the Index of the First Occurrence in a StringEasyA clear explanation of finding the first occurrence of one string inside another using direct string matching.
29LeetCode 29: Divide Two IntegersMediumA clear explanation of integer division without using multiplication, division, or modulo, using repeated doubling with bit shifts.
30LeetCode 30: Substring with Concatenation of All WordsHardA clear explanation of finding all starting indices where a substring is formed by concatenating every word exactly once.
31LeetCode 31: Next PermutationMediumA clear explanation of finding the next lexicographically greater permutation in place using a right-to-left scan.
32LeetCode 32: Longest Valid ParenthesesHardA clear explanation of finding the longest well-formed parentheses substring using a stack of indices.
33LeetCode 33: Search in Rotated Sorted ArrayMediumA clear explanation of searching a rotated sorted array in logarithmic time using modified binary search.
34LeetCode 34: Find First and Last Position of Element in Sorted ArrayMediumA clear explanation of finding the first and last index of a target in a sorted array using two binary searches.
35LeetCode 35: Search Insert PositionEasyA clear explanation of finding the index of a target, or where it should be inserted, using binary search.
36LeetCode 36: Valid SudokuMediumA clear explanation of checking whether a partially filled Sudoku board is valid using hash sets.
37LeetCode 37: Sudoku SolverHardA clear explanation of solving a Sudoku board using backtracking and constraint checking.
38LeetCode 38: Count and SayMediumA clear explanation of generating the count-and-say sequence using run-length encoding.
39LeetCode 39: Combination SumMediumA clear explanation of finding all unique combinations that sum to a target using backtracking.
40LeetCode 40: Combination Sum IIMediumA clear explanation of finding unique combinations that sum to a target when each array element may be used at most once.
41LeetCode 41: First Missing PositiveHardA clear explanation of the First Missing Positive problem using in-place index placement to achieve O(n) time and O(1) extra space.
42LeetCode 42: Trapping Rain WaterHardA clear explanation of the Trapping Rain Water problem using left and right boundaries, then an optimized two-pointer solution.
43LeetCode 43: Multiply StringsMediumA clear explanation of Multiply Strings using grade-school multiplication with digit arrays.
44LeetCode 44: Wildcard MatchingHardA clear explanation of Wildcard Matching using dynamic programming over string and pattern prefixes.
45LeetCode 45: Jump Game IIMediumA clear explanation of Jump Game II using a greedy range expansion approach to find the minimum number of jumps.
46LeetCode 46: PermutationsMediumA clear explanation of Permutations using depth-first search and backtracking.
47LeetCode 47: Permutations IIMediumA clear explanation of Permutations II using sorting, depth-first search, and duplicate-skipping backtracking.
48LeetCode 48: Rotate ImageMediumA clear explanation of Rotate Image using in-place matrix transpose and row reversal.
49LeetCode 49: Group AnagramsMediumA clear explanation of Group Anagrams using a hash map keyed by each word’s sorted character signature.
50LeetCode 50: Pow(x, n)MediumA clear explanation of Pow(x, n) using binary exponentiation to compute powers in logarithmic time.
51LeetCode 51: N-QueensHardA clear guide to solving N-Queens with backtracking, row-by-row placement, and constant-time conflict checks.
52LeetCode 52: N-Queens IIHardA clear guide to solving N-Queens II by counting valid queen placements with backtracking.
53LeetCode 53: Maximum SubarrayMediumA clear guide to solving Maximum Subarray with brute force first, then Kadane’s dynamic programming algorithm.
54LeetCode 54: Spiral MatrixMediumA clear guide to reading a matrix in spiral order using shrinking boundaries.
55LeetCode 55: Jump GameMediumA clear guide to solving Jump Game with greedy reachability.
56LeetCode 56: Merge IntervalsMediumA clear guide to solving Merge Intervals by sorting intervals and merging them in one pass.
57LeetCode 57: Insert IntervalMediumA clear guide to solving Insert Interval with one linear scan over sorted, non-overlapping intervals.
58LeetCode 58: Length of Last WordEasyA clear guide to solving Length of Last Word by scanning the string from right to left.
59LeetCode 59: Spiral Matrix IIMediumA clear guide to generating an n x n matrix filled from 1 to n squared in spiral order.
60LeetCode 60: Permutation SequenceHardA clear guide to finding the kth permutation sequence using factorial blocks instead of generating all permutations.
61LeetCode 61: Rotate ListMediumA clear guide to rotating a linked list to the right by k places using a circular list.
62LeetCode 62: Unique PathsMediumA clear guide to counting unique paths in a grid using dynamic programming.
63LeetCode 63: Unique Paths IIMediumA clear guide to counting unique paths in a grid with obstacles using dynamic programming.
64LeetCode 64: Minimum Path SumMediumA clear guide to finding the minimum path sum in a grid using dynamic programming.
65LeetCode 65: Valid NumberHardA clear guide to validating whether a string is a valid number using grammar rules and one left-to-right scan.
66LeetCode 66: Plus OneEasyA clear guide to adding one to a large integer represented as an array of digits.
67LeetCode 67: Add BinaryEasyA clear guide to adding two binary strings using two pointers and a carry.
68LeetCode 68: Text JustificationHardA clear guide to formatting text with greedy line packing and even space distribution.
69LeetCode 69: Sqrt(x)EasyA clear guide to computing the integer square root using binary search without built-in exponent functions.
70LeetCode 70: Climbing StairsEasyA clear guide to counting distinct ways to climb stairs using dynamic programming.
71LeetCode 71: Simplify PathMediumA clear guide to simplifying Unix-style file paths using a stack.
72LeetCode 72: Edit DistanceHardA clear guide to computing the minimum number of insert, delete, and replace operations needed to convert one string into another.
73LeetCode 73: Set Matrix ZeroesMediumA clear guide to setting matrix rows and columns to zero in place using the first row and first column as markers.
74LeetCode 74: Search a 2D MatrixMediumA clear guide to searching a sorted 2D matrix using binary search over a virtual one-dimensional array.
75LeetCode 75: Sort ColorsMediumA clear guide to sorting an array of 0s, 1s, and 2s in place using the Dutch National Flag algorithm.
76LeetCode 76: Minimum Window SubstringHardA detailed guide to solving Minimum Window Substring with a sliding window and frequency counters.
77LeetCode 77: CombinationsMediumA detailed guide to solving Combinations with backtracking and pruning.
78LeetCode 78: SubsetsMediumA detailed guide to solving Subsets with backtracking and the include-or-skip recursion idea.
79LeetCode 79: Word SearchMediumA detailed guide to solving Word Search with depth-first search and backtracking on a grid.
80LeetCode 80: Remove Duplicates from Sorted Array IIMediumA detailed guide to solving Remove Duplicates from Sorted Array II with an in-place two-pointer method.
81LeetCode 81: Search in Rotated Sorted Array IIMediumA detailed guide to solving Search in Rotated Sorted Array II with modified binary search and duplicate handling.
82LeetCode 82: Remove Duplicates from Sorted List IIMediumA detailed guide to solving Remove Duplicates from Sorted List II with a dummy node and pointer rewiring.
83LeetCode 83: Remove Duplicates from Sorted ListEasyA detailed guide to solving Remove Duplicates from Sorted List with one pointer and in-place linked list rewiring.
84LeetCode 84: Largest Rectangle in HistogramHardA detailed guide to solving Largest Rectangle in Histogram with a monotonic increasing stack.
85LeetCode 85: Maximal RectangleHardA detailed guide to solving Maximal Rectangle by converting each matrix row into a histogram and applying a monotonic stack.
86LeetCode 86: Partition ListMediumA detailed guide to solving Partition List with two dummy lists while preserving relative order.
87LeetCode 87: Scramble StringHardA detailed guide to solving Scramble String with recursive dynamic programming and memoization.
88LeetCode 88: Merge Sorted ArrayEasyA detailed guide to solving Merge Sorted Array in-place by merging from the back with three pointers.
89LeetCode 89: Gray CodeMediumA detailed guide to solving Gray Code using the binary-to-Gray-code formula.
90LeetCode 90: Subsets IIMediumA detailed guide to solving Subsets II with sorting, backtracking, and duplicate skipping.
91LeetCode 91: Decode WaysMediumA detailed guide to solving Decode Ways with dynamic programming and careful handling of zeroes.
92LeetCode 92: Reverse Linked List IIMediumA detailed guide to solving Reverse Linked List II with a dummy node and in-place sublist reversal.
93LeetCode 93: Restore IP AddressesMediumA detailed guide to solving Restore IP Addresses with backtracking over four valid IP segments.
94LeetCode 94: Binary Tree Inorder TraversalEasyA detailed guide to solving Binary Tree Inorder Traversal with recursion and an iterative stack.
95LeetCode 95: Unique Binary Search Trees IIMediumA detailed guide to solving Unique Binary Search Trees II with recursive tree generation over value ranges.
96LeetCode 96: Unique Binary Search TreesMediumA detailed guide to solving Unique Binary Search Trees with dynamic programming and the Catalan recurrence.
97LeetCode 97: Interleaving StringMediumA detailed guide to solving Interleaving String with two-dimensional dynamic programming.
98LeetCode 98: Validate Binary Search TreeMediumA detailed guide to solving Validate Binary Search Tree with recursive lower and upper bounds.
99LeetCode 99: Recover Binary Search TreeMediumA detailed guide to solving Recover Binary Search Tree with inorder traversal and two misplaced nodes.
100LeetCode 100: Same TreeEasyA detailed guide to solving Same Tree with recursive DFS and structural comparison.
101LeetCode 101: Symmetric TreeEasyA clear explanation of checking whether a binary tree is symmetric using mirror recursion.
102LeetCode 102: Binary Tree Level Order TraversalMediumA clear explanation of binary tree level order traversal using breadth-first search and a queue.
103LeetCode 103: Binary Tree Zigzag Level Order TraversalMediumA clear explanation of zigzag level order traversal using breadth-first search and alternating level direction.
104LeetCode 104: Maximum Depth of Binary TreeEasyA clear explanation of finding the maximum depth of a binary tree using recursive depth-first search.
105LeetCode 105: Construct Binary Tree from Preorder and Inorder TraversalMediumA clear explanation of rebuilding a binary tree from preorder and inorder traversals using recursion and an index map.
106LeetCode 106: Construct Binary Tree from Inorder and Postorder TraversalMediumA clear explanation of rebuilding a binary tree from inorder and postorder traversals using recursion and an index map.
107LeetCode 107: Binary Tree Level Order Traversal IIMediumA clear explanation of returning binary tree levels from bottom to top using breadth-first search.
108LeetCode 108: Convert Sorted Array to Binary Search TreeEasyA clear explanation of building a height-balanced binary search tree from a sorted array using divide and conquer.
109LeetCode 109: Convert Sorted List to Binary Search TreeMediumA clear explanation of converting a sorted linked list into a height-balanced binary search tree using slow and fast pointers.
110LeetCode 110: Balanced Binary TreeEasyA clear explanation of checking whether a binary tree is height-balanced using bottom-up depth-first search.
111LeetCode 111: Minimum Depth of Binary TreeEasyA clear explanation of finding the minimum depth of a binary tree using breadth-first search.
112LeetCode 112: Path SumEasyA clear explanation of checking whether a binary tree has a root-to-leaf path whose values add up to a target sum.
113LeetCode 113: Path Sum IIMediumA clear explanation of finding all root-to-leaf paths whose values add up to a target sum using depth-first search and backtracking.
114LeetCode 114: Flatten Binary Tree to Linked ListMediumA clear explanation of flattening a binary tree into a linked list in preorder traversal order using recursive depth-first search.
115LeetCode 115: Distinct SubsequencesHardA clear explanation of counting distinct subsequences using dynamic programming.
116LeetCode 116: Populating Next Right Pointers in Each NodeMediumA clear explanation of connecting next pointers in a perfect binary tree using constant extra space.
117LeetCode 117: Populating Next Right Pointers in Each Node IIMediumA clear explanation of connecting next pointers in any binary tree using constant extra space.
118LeetCode 118: Pascal’s TriangleEasyA clear explanation of generating Pascal’s Triangle row by row using dynamic programming.
119LeetCode 119: Pascal’s Triangle IIEasyA clear explanation of generating a single row of Pascal’s Triangle using in-place dynamic programming.
120LeetCode 120: TriangleMediumA clear explanation of finding the minimum path sum in a triangle using bottom-up dynamic programming.
121LeetCode 121: Best Time to Buy and Sell StockEasyA clear explanation of finding the maximum profit from one stock transaction using a single pass.
122LeetCode 122: Best Time to Buy and Sell Stock IIMediumA clear explanation of maximizing stock profit with unlimited transactions using a greedy single-pass method.
123LeetCode 123: Best Time to Buy and Sell Stock IIIHardA clear explanation of maximizing stock profit with at most two transactions using dynamic programming.
124LeetCode 124: Binary Tree Maximum Path SumHardA clear explanation of finding the maximum path sum in a binary tree using bottom-up depth-first search.
125LeetCode 125: Valid PalindromeEasyA clear explanation of checking whether a string is a palindrome after ignoring non-alphanumeric characters and case.
126LeetCode 126: Word Ladder IIHardFind all shortest word transformation sequences using BFS to build shortest-path parents, then backtracking to reconstruct every answer.
127LeetCode 127: Word LadderHardUse breadth-first search to find the shortest transformation sequence length between two words.
128LeetCode 128: Longest Consecutive SequenceMediumFind the longest run of consecutive integers in an unsorted array using a hash set and sequence-start detection.
129LeetCode 129: Sum Root to Leaf NumbersMediumCompute the sum of all numbers formed by root-to-leaf paths using depth-first search and decimal accumulation.
130LeetCode 130: Surrounded RegionsMediumCapture surrounded O regions by marking border-connected O cells first, then flipping the remaining O cells.
131LeetCode 131: Palindrome PartitioningMediumGenerate all ways to split a string so that every piece is a palindrome, using backtracking with palindrome precomputation.
132LeetCode 132: Palindrome Partitioning IIHardFind the minimum number of cuts needed to split a string into palindromic substrings using palindrome precomputation and dynamic programming.
133LeetCode 133: Clone GraphMediumCreate a deep copy of a connected undirected graph using DFS and a hash map from original nodes to cloned nodes.
134LeetCode 134: Gas StationMediumFind the unique starting gas station index using a greedy scan with total fuel balance and current tank balance.
135LeetCode 135: CandyHardCompute the minimum candies needed using two greedy passes, one from the left and one from the right.
136LeetCode 136: Single NumberEasyFind the only number that appears once using the XOR operator, while every other number appears exactly twice.
137LeetCode 137: Single Number IIMediumFind the number that appears once when every other number appears three times using bit counting or finite-state bit manipulation.
138LeetCode 138: Copy List with Random PointerMediumCreate a deep copy of a linked list with next and random pointers using hash maps or interleaved node cloning.
139LeetCode 139: Word BreakMediumDecide whether a string can be segmented into dictionary words using dynamic programming over prefixes.
140LeetCode 140: Word Break IIHardReturn all valid sentences formed by inserting spaces into a string so every word belongs to the dictionary, using DFS with memoization.
141LeetCode 141: Linked List CycleEasyDetect whether a linked list contains a cycle using Floyd’s tortoise and hare two-pointer algorithm.
142LeetCode 142: Linked List Cycle IIMediumFind the node where a linked list cycle begins using Floyd’s tortoise and hare algorithm with cycle entry mathematics.
143LeetCode 143: Reorder ListMediumReorder a singly linked list in-place by finding the middle, reversing the second half, and merging the two halves alternately.
144LeetCode 144: Binary Tree Preorder TraversalEasyReturn the preorder traversal of a binary tree using recursion or an explicit stack.
145LeetCode 145: Binary Tree Postorder TraversalEasyReturn the postorder traversal of a binary tree using recursion or an iterative stack-based approach.
146LeetCode 146: LRU CacheMediumDesign an LRU cache with O(1) get and put operations using a hash map and doubly linked list.
147LeetCode 147: Insertion Sort ListMediumSort a singly linked list using insertion sort by splicing each node into a growing sorted list.
148LeetCode 148: Sort ListMediumSort a singly linked list in ascending order using merge sort with fast and slow pointers.
149LeetCode 149: Max Points on a LineHardFind the maximum number of points lying on the same straight line using slope counting and normalization.
150LeetCode 150: Evaluate Reverse Polish NotationMediumEvaluate an arithmetic expression written in Reverse Polish Notation using a stack.
151LeetCode 151: Reverse Words in a StringMediumA clear explanation of reversing word order while removing extra spaces.
152LeetCode 152: Maximum Product SubarrayMediumA detailed explanation of tracking both maximum and minimum products while scanning the array.
153LeetCode 153: Find Minimum in Rotated Sorted ArrayMediumA clear explanation of finding the minimum element in a rotated sorted array using binary search.
154LeetCode 154: Find Minimum in Rotated Sorted Array IIHardA clear explanation of finding the minimum element in a rotated sorted array that may contain duplicates.
155LeetCode 155: Min StackMediumA clear explanation of designing a stack that can return the current minimum element in constant time.
156LeetCode 156: Binary Tree Upside DownMediumA clear explanation of flipping a binary tree upside down by rewiring pointers from the left spine.
157LeetCode 157: Read N Characters Given Read4EasyA clear explanation of implementing read using the given read4 API and copying only the needed characters.
158LeetCode 158: Read N Characters Given read4 II - Call Multiple TimesHardA clear explanation of implementing read with read4 when read may be called multiple times.
159LeetCode 159: Longest Substring with At Most Two Distinct CharactersMediumA clear explanation of finding the longest substring with at most two distinct characters using a sliding window.
160LeetCode 160: Intersection of Two Linked ListsEasyA clear explanation of finding the node where two singly linked lists intersect using two pointers.
161LeetCode 161: One Edit DistanceMediumA clear explanation of checking whether two strings are exactly one edit apart using a linear scan.
162LeetCode 162: Find Peak ElementMediumA clear explanation of finding any peak element using binary search on the slope of the array.
163LeetCode 163: Missing RangesEasyA clear explanation of finding all missing ranges inside an inclusive interval by scanning sorted unique numbers.
164LeetCode 164: Maximum GapMediumA clear explanation of finding the maximum adjacent gap in sorted order using buckets and the pigeonhole principle.
165LeetCode 165: Compare Version NumbersMediumA clear explanation of comparing version strings revision by revision while ignoring leading zeros.
166LeetCode 166: Fraction to Recurring DecimalMediumA clear explanation of converting a fraction into decimal form and detecting repeating fractional parts with a hash map.
167LeetCode 167: Two Sum II - Input Array Is SortedMediumA clear explanation of finding two numbers in a sorted array using two pointers and constant extra space.
168LeetCode 168: Excel Sheet Column TitleEasyA clear explanation of converting a positive integer into an Excel column title using bijective base 26.
169LeetCode 169: Majority ElementEasyA clear explanation of finding the element that appears more than half the time using Boyer-Moore voting.
170LeetCode 170: Two Sum III - Data Structure DesignEasyA clear explanation of designing a data structure that supports add and find operations for pair sums.
171LeetCode 171: Excel Sheet Column NumberEasyA clear explanation of converting an Excel column title into its numeric index using base 26 accumulation.
172LeetCode 172: Factorial Trailing ZeroesMediumA clear explanation of counting trailing zeroes in n! by counting factors of 5 instead of computing the factorial directly.
173LeetCode 173: Binary Search Tree IteratorMediumA clear explanation of designing an iterator over a BST using controlled inorder traversal with a stack.
174LeetCode 174: Dungeon GameHardA clear explanation of computing the minimum initial health needed to survive a dungeon using reverse dynamic programming.
175LeetCode 175: Combine Two TablesEasyA clear SQL guide for solving Combine Two Tables using LEFT JOIN.
176LeetCode 176: Second Highest SalaryMediumA clear SQL solution for finding the second highest distinct salary from the Employee table.
177LeetCode 177: Nth Highest SalaryMediumA clear SQL solution for finding the nth highest distinct salary from the Employee table.
178LeetCode 178: Rank ScoresMediumA clear SQL solution for ranking scores with dense ranking, where ties share the same rank and no rank numbers are skipped.
179LeetCode 179: Largest NumberMediumA clear explanation of arranging non-negative integers to form the largest possible concatenated number using a custom sort order.
180LeetCode 180: Consecutive NumbersMediumA clear SQL solution for finding numbers that appear at least three times consecutively in the Logs table.
181LeetCode 181: Employees Earning More Than Their ManagersEasyA clear SQL solution for finding employees whose salary is greater than their manager’s salary using a self join.
182LeetCode 182: Duplicate EmailsEasyA clear SQL solution for reporting email values that appear more than once in the Person table.
183LeetCode 183: Customers Who Never OrderEasyA clear SQL solution for finding customers who have no matching rows in the Orders table.
184LeetCode 184: Department Highest SalaryMediumA clear SQL solution for finding every employee who earns the highest salary in their department.
185LeetCode 185: Department Top Three SalariesHardA clear SQL solution for finding employees whose salaries are in the top three unique salary levels within their department.
186LeetCode 186: Reverse Words in a String IIMediumA clear explanation of reversing the order of words in a character array in-place using two reversals.
187LeetCode 187: Repeated DNA SequencesMediumA clear explanation of finding repeated 10-letter DNA substrings using a fixed-size sliding window and hash sets.
188LeetCode 188: Best Time to Buy and Sell Stock IVHardA clear explanation of maximizing stock trading profit with at most k transactions using dynamic programming.
189LeetCode 189: Rotate ArrayMediumA clear explanation of rotating an array to the right by k steps using in-place reversal.
190LeetCode 190: Reverse BitsEasyA clear explanation of reversing the bits of a 32-bit integer using bit manipulation.
191LeetCode 191: Number of 1 BitsEasyA clear explanation of counting set bits in an integer using bit manipulation and Brian Kernighan’s algorithm.
192LeetCode 192: Word FrequencyMediumA clear explanation of the Word Frequency shell problem using Unix text-processing tools.
193LeetCode 193: Valid Phone NumbersEasyA clear explanation of the Valid Phone Numbers shell problem using grep and regular expressions.
194LeetCode 194: Transpose FileMediumA clear explanation of the Transpose File shell problem using awk to transform rows into columns.
195LeetCode 195: Tenth LineEasyA clear explanation of the Tenth Line shell problem using awk, sed, head, and tail.
196LeetCode 196: Delete Duplicate EmailsEasyA clear explanation of the Delete Duplicate Emails SQL problem using DELETE with a self join.
197LeetCode 197: Rising TemperatureEasyA clear explanation of the Rising Temperature SQL problem using a self join and date comparison.
198LeetCode 198: House RobberMediumA clear explanation of maximizing robbery profit without robbing adjacent houses using dynamic programming.
199LeetCode 199: Binary Tree Right Side ViewMediumA clear explanation of returning the visible nodes from the right side of a binary tree using level-order traversal.
200LeetCode 200: Number of IslandsMediumA clear explanation of counting connected groups of land cells in a grid using DFS or BFS.
201LeetCode 201: Bitwise AND of Numbers RangeMediumA clear explanation of finding the bitwise AND of every number in an inclusive range using the common binary prefix.
202LeetCode 202: Happy NumberEasyA clear explanation of detecting whether repeated digit-square sums eventually reach 1.
203LeetCode 203: Remove Linked List ElementsEasyA clear explanation of removing all linked list nodes with a target value using iteration and a dummy node.
204LeetCode 204: Count PrimesMediumA clear explanation of counting prime numbers less than n using the Sieve of Eratosthenes.
205LeetCode 205: Isomorphic StringsEasyA clear explanation of checking whether two strings follow the same character mapping pattern.
206LeetCode 206: Reverse Linked ListEasyA clear explanation of reversing a singly linked list using iterative and recursive approaches.
207LeetCode 207: Course ScheduleMediumA clear explanation of detecting cycles in a prerequisite graph using topological sorting and DFS.
208LeetCode 208: Implement Trie Prefix TreeMediumA clear explanation of implementing a Trie with insert, search, and startsWith operations.
209LeetCode 209: Minimum Size Subarray SumMediumA clear explanation of finding the shortest contiguous subarray whose sum is at least target using a sliding window.
210LeetCode 210: Course Schedule IIMediumA clear explanation of finding a valid course ordering using topological sorting and cycle detection.
211LeetCode 211: Design Add and Search Words Data StructureMediumA clear explanation of designing a word dictionary with addWord and wildcard search using a Trie and DFS.
212LeetCode 212: Word Search IIHardA clear explanation of finding multiple words in a character board using a Trie and DFS backtracking.
213LeetCode 213: House Robber IIMediumA clear explanation of maximizing robbed money from circularly arranged houses using dynamic programming.
214LeetCode 214: Shortest PalindromeHardA clear explanation of building the shortest palindrome by finding the longest palindromic prefix using KMP.
215LeetCode 215: Kth Largest Element in an ArrayMediumA clear explanation of finding the kth largest element using sorting, a min-heap, and Quickselect.
216LeetCode 216: Combination Sum IIIMediumA clear explanation of finding k distinct numbers from 1 to 9 that sum to n using backtracking.
217LeetCode 217: Contains DuplicateEasyA clear explanation of detecting duplicates in an array using a hash set and sorting.
218LeetCode 218: The Skyline ProblemHardA clear explanation of computing the skyline formed by buildings using sweep line and a max-heap.
219LeetCode 219: Contains Duplicate IIEasyA clear explanation of detecting whether equal values appear within distance k using a hash map or sliding window set.
220LeetCode 220: Contains Duplicate IIIHardA clear explanation of checking nearby indices with nearby values using a sliding window and bucket hashing.
221LeetCode 221: Maximal SquareMediumA clear explanation of finding the largest square of 1s in a binary matrix using dynamic programming.
222LeetCode 222: Count Complete Tree NodesEasyA clear explanation of counting nodes in a complete binary tree faster than visiting every node.
223LeetCode 223: Rectangle AreaMediumA clear explanation of computing the total covered area of two axis-aligned rectangles by subtracting their overlap.
224LeetCode 224: Basic CalculatorHardA clear explanation of evaluating an expression with plus, minus, spaces, and parentheses using a stack.
225LeetCode 225: Implement Stack using QueuesEasyA clear explanation of implementing a LIFO stack using only FIFO queue operations.
226LeetCode 226: Invert Binary TreeEasyA clear explanation of inverting a binary tree using recursive depth-first traversal.
227LeetCode 227: Basic Calculator IIMediumA detailed explanation of evaluating arithmetic expressions with stack-based parsing and operator precedence.
228LeetCode 228: Summary RangesEasyA clear explanation of summarizing a sorted unique integer array into compact consecutive ranges.
229LeetCode 229: Majority Element IIMediumA clear explanation of finding all elements that appear more than n/3 times using the extended Boyer-Moore voting algorithm.
230LeetCode 230: Kth Smallest Element in a BSTMediumA clear explanation of finding the kth smallest value in a binary search tree using inorder traversal.
231LeetCode 231: Power of TwoEasyA clear explanation of determining whether an integer is a power of two using binary properties and bit manipulation.
232LeetCode 232: Implement Queue using StacksEasyA detailed explanation of implementing a FIFO queue using two LIFO stacks with amortized constant time operations.
233LeetCode 233: Number of Digit OneHardA detailed explanation of counting how many times digit one appears from 0 to n using positional digit analysis.
234LeetCode 234: Palindrome Linked ListEasyA clear explanation of checking whether a singly linked list is a palindrome using fast and slow pointers plus in-place reversal.
235LeetCode 235: Lowest Common Ancestor of a Binary Search TreeMediumA clear explanation of finding the lowest common ancestor in a binary search tree using BST ordering properties.
236LeetCode 236: Lowest Common Ancestor of a Binary TreeMediumA clear explanation of finding the lowest common ancestor in a normal binary tree using recursive depth-first search.
237LeetCode 237: Delete Node in a Linked ListMediumA clear explanation of deleting a node from a singly linked list when only that node is given.
238LeetCode 238: Product of Array Except SelfMediumA clear explanation of computing each product except self using prefix and suffix products without division.
239LeetCode 239: Sliding Window MaximumHardA clear explanation of finding the maximum value in every sliding window using a monotonic deque.
240LeetCode 240: Search a 2D Matrix IIMediumA clear explanation of searching a row-sorted and column-sorted matrix using the top-right corner elimination method.
241LeetCode 241: Different Ways to Add ParenthesesMediumA clear explanation of generating all possible results from different parenthesizations using divide and conquer recursion.
242LeetCode 242: Valid AnagramEasyA clear explanation of checking whether two strings are anagrams using character frequency counting.
243LeetCode 243: Shortest Word DistanceEasyA clear explanation of the Shortest Word Distance problem using one pass and the latest seen indices of both words.
244LeetCode 244: Shortest Word Distance IIMediumA clear explanation of the Shortest Word Distance II problem using preprocessing and two pointers.
245LeetCode 245: Shortest Word Distance IIIMediumA clear explanation of the Shortest Word Distance III problem, including the special case where both target words are the same.
246LeetCode 246: Strobogrammatic NumberEasyA clear explanation of the Strobogrammatic Number problem using digit rotation rules and two pointers.
247LeetCode 247: Strobogrammatic Number IIMediumA clear explanation of generating all strobogrammatic numbers of length n using recursion from the inside out.
248LeetCode 248: Strobogrammatic Number IIIHardA clear explanation of counting strobogrammatic numbers in a string range using recursive generation and range filtering.
249LeetCode 249: Group Shifted StringsMediumA clear explanation of grouping strings by their shifting sequence using normalized hash keys.
250LeetCode 250: Count Univalue SubtreesMediumA clear explanation of counting uni-value subtrees using post-order DFS.
251LeetCode 251: Flatten 2D VectorMediumA clear explanation of the Flatten 2D Vector problem using row and column pointers to implement an iterator.
252LeetCode 252: Meeting RoomsEasyA clear explanation of the Meeting Rooms problem using interval sorting to detect overlaps.
253LeetCode 253: Meeting Rooms IIMediumA clear explanation of the Meeting Rooms II problem using a min heap to track active meeting end times.
254LeetCode 254: Factor CombinationsMediumA clear explanation of the Factor Combinations problem using DFS backtracking with non-decreasing factors.
255LeetCode 255: Verify Preorder Sequence in Binary Search TreeMediumA clear explanation of the Verify Preorder Sequence in Binary Search Tree problem using a monotonic stack and lower bound tracking.
256LeetCode 256: Paint HouseMediumA clear explanation of the Paint House problem using dynamic programming with constant space.
257LeetCode 257: Binary Tree PathsEasyA clear explanation of the Binary Tree Paths problem using DFS backtracking to collect every root-to-leaf path.
258LeetCode 258: Add DigitsEasyA clear explanation of the Add Digits problem using repeated digit sums first, then the digital root formula.
259LeetCode 259: 3Sum SmallerMediumA clear explanation of the 3Sum Smaller problem using sorting and the two-pointer technique.
260LeetCode 260: Single Number IIIMediumA clear explanation of the Single Number III problem using XOR partitioning to isolate the two unique numbers.
261LeetCode 261: Graph Valid TreeMediumA clear explanation of the Graph Valid Tree problem using Union Find to detect cycles and verify connectivity.
262LeetCode 262: Trips and UsersHardA clear explanation of the Trips and Users SQL problem using joins, filtering, grouping, and conditional aggregation.
263LeetCode 263: Ugly NumberEasyA clear explanation of the Ugly Number problem using repeated division by the only allowed prime factors.
264LeetCode 264: Ugly Number IIMediumA clear explanation of the Ugly Number II problem using dynamic programming with three pointers.
265LeetCode 265: Paint House IIHardA clear explanation of the Paint House II problem using optimized dynamic programming with minimum and second minimum tracking.
266LeetCode 266: Palindrome PermutationEasyA clear explanation of the Palindrome Permutation problem using character parity counting.
267LeetCode 267: Palindrome Permutation IIMediumA clear explanation of the Palindrome Permutation II problem using character counts and backtracking over half of the palindrome.
268LeetCode 268: Missing NumberEasyA clear explanation of the Missing Number problem using sum formula and XOR.
269LeetCode 269: Alien DictionaryHardA clear explanation of the Alien Dictionary problem using graph construction and topological sorting.
270LeetCode 270: Closest Binary Search Tree ValueEasyA clear explanation of the Closest Binary Search Tree Value problem using the BST property to walk toward the target.
271LeetCode 271: Encode and Decode StringsMediumA clear explanation of the Encode and Decode Strings problem using length-prefix encoding.
272LeetCode 272: Closest Binary Search Tree Value IIHardA clear explanation of the Closest Binary Search Tree Value II problem using inorder traversal and a fixed-size sliding window.
273LeetCode 273: Integer to English WordsHardA clear explanation of the Integer to English Words problem using three-digit chunks and scale words.
274LeetCode 274: H-IndexMediumA clear explanation of the H-Index problem using sorting, then an optimized counting approach.
275LeetCode 275: H-Index IIMediumA clear explanation of the H-Index II problem using binary search on a sorted citations array.
276LeetCode 276: Paint FenceMediumA dynamic programming solution for counting ways to paint fence posts with no more than two adjacent posts sharing the same color.
277LeetCode 277: Find the CelebrityMediumA two-pass solution for finding a celebrity using the knows API with O(n) calls and O(1) extra space.
278LeetCode 278: First Bad VersionEasyA binary search solution for finding the first bad version while minimizing calls to the isBadVersion API.
279LeetCode 279: Perfect SquaresMediumA dynamic programming solution for finding the least number of perfect square numbers that sum to n.
280LeetCode 280: Wiggle SortMediumA greedy in-place solution for rearranging an array into a non-strict wiggle pattern.
281LeetCode 281: Zigzag IteratorMediumA queue-based iterator design for returning elements from two vectors in alternating order, with a clean extension to k vectors.
282LeetCode 282: Expression Add OperatorsHardA backtracking solution for inserting operators into a numeric string so the expression evaluates to a target value.
283LeetCode 283: Move ZeroesEasyA two-pointer in-place solution for moving all zeroes to the end while preserving the relative order of non-zero elements.
284LeetCode 284: Peeking IteratorMediumA wrapper iterator design that supports peeking at the next element without advancing the iterator.
285LeetCode 285: Inorder Successor in BSTMediumA binary-search-style solution for finding the smallest node greater than p in a binary search tree.
286LeetCode 286: Walls and GatesMediumA multi-source BFS solution for filling each empty room with its shortest distance to the nearest gate.
287LeetCode 287: Find the Duplicate NumberMediumA Floyd cycle detection solution for finding the repeated number without modifying the array and using constant extra space.
288LeetCode 288: Unique Word AbbreviationMediumA hash map design for checking whether a word’s abbreviation is unique in a dictionary.
289LeetCode 289: Game of LifeMediumAn in-place matrix simulation for computing the next state of Conway’s Game of Life using temporary encoded states.
290LeetCode 290: Word PatternEasyA hash map solution for checking whether a pattern string and a space-separated word string form a bijection.
291LeetCode 291: Word Pattern IIMediumA backtracking solution for matching a pattern string to a target string using a bijective character-to-substring mapping.
292LeetCode 292: Nim GameEasyA game theory solution for deciding whether the first player can win by using the losing-position pattern of multiples of four.
293LeetCode 293: Flip GameEasyA simple string scanning solution for generating every possible next state after flipping one consecutive ++ pair into –.
294LeetCode 294: Flip Game IIMediumA recursive game theory solution with memoization for deciding whether the starting player can force a win.
295LeetCode 295: Find Median from Data StreamHardA two-heap data structure for adding numbers from a stream and returning the current median in constant time.
296LeetCode 296: Best Meeting PointHardA median-based solution for minimizing total Manhattan distance in a grid.
297LeetCode 297: Serialize and Deserialize Binary TreeHardA preorder DFS codec for converting a binary tree to a string and reconstructing the same tree from that string.
298LeetCode 298: Binary Tree Longest Consecutive SequenceMediumA DFS solution for finding the longest parent-to-child path where each node value increases by exactly one.
299LeetCode 299: Bulls and CowsMediumA counting solution for producing the Bulls and Cows hint while handling duplicate digits correctly.
300LeetCode 300: Longest Increasing SubsequenceMediumA dynamic programming and patience sorting solution for finding the longest strictly increasing subsequence in an array.
301LeetCode 301: Remove Invalid ParenthesesHardA clear explanation of Remove Invalid Parentheses using BFS to guarantee the minimum number of removals.
302LeetCode 302: Smallest Rectangle Enclosing Black PixelsHardA clear explanation of Smallest Rectangle Enclosing Black Pixels using binary search on rows and columns.
303LeetCode 303: Range Sum Query - ImmutableEasyA clear explanation of Range Sum Query - Immutable using prefix sums for constant-time range queries.
304LeetCode 304: Range Sum Query 2D - ImmutableMediumA clear explanation of Range Sum Query 2D - Immutable using a 2D prefix sum matrix for constant-time rectangle queries.
305LeetCode 305: Number of Islands IIHardA clear explanation of Number of Islands II using Union-Find to dynamically merge connected land cells.
306LeetCode 306: Additive NumberMediumA clear explanation of Additive Number using split enumeration and deterministic checking.
307LeetCode 307: Range Sum Query - MutableMediumA clear explanation of Range Sum Query - Mutable using a Fenwick Tree for efficient updates and range sums.
308LeetCode 308: Range Sum Query 2D - MutableHardA clear explanation of Range Sum Query 2D - Mutable using a 2D Fenwick Tree for efficient updates and rectangle sum queries.
309LeetCode 309: Best Time to Buy and Sell Stock with CooldownMediumA clear explanation of Best Time to Buy and Sell Stock with Cooldown using dynamic programming states.
310LeetCode 310: Minimum Height TreesMediumA clear explanation of Minimum Height Trees using leaf trimming to find the center of a tree.
311LeetCode 311: Sparse Matrix MultiplicationMediumA clear explanation of Sparse Matrix Multiplication using non-zero entries to avoid wasted work.
312LeetCode 312: Burst BalloonsHardA clear explanation of Burst Balloons using interval dynamic programming and the last-burst idea.
313LeetCode 313: Super Ugly NumberMediumA clear explanation of Super Ugly Number using dynamic programming with one pointer per prime.
314LeetCode 314: Binary Tree Vertical Order TraversalMediumA clear explanation of Binary Tree Vertical Order Traversal using BFS with column indices.
315LeetCode 315: Count of Smaller Numbers After SelfHardA clear explanation of Count of Smaller Numbers After Self using coordinate compression and a Fenwick Tree.
316LeetCode 316: Remove Duplicate LettersMediumA clear explanation of Remove Duplicate Letters using a greedy monotonic stack.
317LeetCode 317: Shortest Distance from All BuildingsHardA clear explanation of Shortest Distance from All Buildings using BFS from each building with distance and reach accumulation.
318LeetCode 318: Maximum Product of Word LengthsMediumA clear explanation of Maximum Product of Word Lengths using bit masks to test disjoint character sets efficiently.
319LeetCode 319: Bulb SwitcherMediumA clear explanation of Bulb Switcher using divisor parity and perfect squares.
320LeetCode 320: Generalized AbbreviationMediumA clear explanation of Generalized Abbreviation using backtracking to choose whether each character is kept or abbreviated.
321LeetCode 321: Create Maximum NumberHardA clear explanation of Create Maximum Number using monotonic stacks for subsequences and greedy merging.
322LeetCode 322: Coin ChangeMediumA clear explanation of Coin Change using dynamic programming for minimum coin count.
323LeetCode 323: Number of Connected Components in an Undirected GraphMediumA clear explanation of counting connected components using Union-Find and graph traversal.
324LeetCode 324: Wiggle Sort IIMediumA clear explanation of Wiggle Sort II using sorting, median splitting, and virtual indexing.
325LeetCode 325: Maximum Size Subarray Sum Equals kMediumA clear explanation of Maximum Size Subarray Sum Equals k using prefix sums and earliest-index hashing.
326LeetCode 326: Power of ThreeEasyA clear explanation of the Power of Three problem using repeated division and integer arithmetic.
327LeetCode 327: Count of Range SumHardA clear explanation of Count of Range Sum using prefix sums and merge sort counting.
328LeetCode 328: Odd Even Linked ListMediumA clear explanation of Odd Even Linked List using in-place pointer rewiring.
329LeetCode 329: Longest Increasing Path in a MatrixHardA clear explanation of Longest Increasing Path in a Matrix using DFS with memoization.
330LeetCode 330: Patching ArrayHardA clear explanation of Patching Array using a greedy smallest-missing-sum invariant.
331LeetCode 331: Verify Preorder Serialization of a Binary TreeMediumA clear explanation of verifying preorder serialization using slot counting without reconstructing the tree.
332LeetCode 332: Reconstruct ItineraryHardA clear explanation of Reconstruct Itinerary using a directed graph and Hierholzer’s algorithm.
333LeetCode 333: Largest BST SubtreeMediumA clear explanation of Largest BST Subtree using postorder traversal and subtree state propagation.
334LeetCode 334: Increasing Triplet SubsequenceMediumA clear explanation of Increasing Triplet Subsequence using greedy tracking of two minimum values.
335LeetCode 335: Self CrossingHardA clear explanation of Self Crossing using constant-space checks for the only possible crossing patterns.
336LeetCode 336: Palindrome PairsHardA clear explanation of Palindrome Pairs using reversed-word lookup and palindrome split checks.
337LeetCode 337: House Robber IIIMediumA clear explanation of House Robber III using tree dynamic programming with rob and skip states.
338LeetCode 338: Counting BitsEasyA clear explanation of Counting Bits using dynamic programming and bit manipulation.
339LeetCode 339: Nested List Weight SumMediumA clear explanation of Nested List Weight Sum using depth-first search over a nested structure.
340LeetCode 340: Longest Substring with At Most K Distinct CharactersMediumA clear explanation of Longest Substring with At Most K Distinct Characters using a sliding window and character counts.
341LeetCode 341: Flatten Nested List IteratorMediumA clear explanation of Flatten Nested List Iterator using lazy stack-based flattening.
342LeetCode 342: Power of FourEasyA clear explanation of Power of Four using bit manipulation and binary properties.
343LeetCode 343: Integer BreakMediumA clear explanation of Integer Break using dynamic programming, with a note on the greedy math solution.
344LeetCode 344: Reverse StringEasyA clear explanation of Reverse String using two pointers and in-place swaps.
345LeetCode 345: Reverse Vowels of a StringEasyA clear explanation of Reverse Vowels of a String using two pointers and selective swaps.
346LeetCode 346: Moving Average from Data StreamEasyA clear explanation of Moving Average from Data Stream using a queue and rolling sum.
347LeetCode 347: Top K Frequent ElementsMediumA clear explanation of Top K Frequent Elements using frequency counting and bucket sort.
348LeetCode 348: Design Tic-Tac-ToeMediumA clear explanation of Design Tic-Tac-Toe using row, column, and diagonal counters for constant-time winner checks.
349LeetCode 349: Intersection of Two ArraysEasyA clear explanation of Intersection of Two Arrays using hash sets for uniqueness and fast lookup.
350LeetCode 350: Intersection of Two Arrays IIEasyA clear explanation of Intersection of Two Arrays II using frequency counting.
351LeetCode 351: Android Unlock PatternsMediumA clear explanation of Android Unlock Patterns using backtracking, a jump table, and symmetry optimization.
352LeetCode 352: Data Stream as Disjoint IntervalsHardA clear explanation of maintaining disjoint sorted intervals from a stream using insertion and merging.
353LeetCode 353: Design Snake GameMediumA clear explanation of implementing Snake Game with a deque for body order and a set for constant-time collision checks.
354LeetCode 354: Russian Doll EnvelopesHardA clear explanation of solving Russian Doll Envelopes using sorting and longest increasing subsequence.
355LeetCode 355: Design TwitterMediumA clear explanation of implementing a simplified Twitter using hash maps, sets, timestamps, and a heap.
356LeetCode 356: Line ReflectionMediumA clear explanation of checking whether 2D points are symmetric around a vertical line using min and max x-coordinates.
357LeetCode 357: Count Numbers with Unique DigitsMediumA clear explanation of counting numbers with unique digits using combinatorics.
358LeetCode 358: Rearrange String k Distance ApartHardA clear explanation of rearranging a string so equal characters are at least k positions apart using a heap and cooldown queue.
359LeetCode 359: Logger Rate LimiterEasyA clear explanation of designing a logger that prints each message at most once every 10 seconds using a hash map.
360LeetCode 360: Sort Transformed ArrayMediumA clear explanation of sorting values after applying a quadratic function using two pointers.
361LeetCode 361: Bomb EnemyMediumA clear explanation of finding the best bomb placement in a grid using cached row and column segment counts.
362LeetCode 362: Design Hit CounterMediumA clear explanation of designing a hit counter for the last 5 minutes using a queue with compressed timestamps.
363LeetCode 363: Max Sum of Rectangle No Larger Than KHardA clear explanation of reducing a 2D rectangle problem to a 1D prefix-sum problem with binary search.
364LeetCode 364: Nested List Weight Sum IIMediumA clear explanation of computing inverse depth weighted sum using level-order traversal.
365LeetCode 365: Water and Jug ProblemMediumA clear explanation of solving the Water and Jug Problem using Bézout’s identity and greatest common divisor.
366LeetCode 366: Find Leaves of Binary TreeMediumA clear explanation of grouping binary tree nodes by the round in which they become leaves using postorder DFS.
367LeetCode 367: Valid Perfect SquareEasyA clear explanation of checking whether an integer is a perfect square using binary search without sqrt.
368LeetCode 368: Largest Divisible SubsetMediumA clear explanation of finding the largest subset where every pair is divisible using sorting, dynamic programming, and parent reconstruction.
369LeetCode 369: Plus One Linked ListMediumA clear explanation of adding one to a number stored as a linked list using the rightmost non-nine digit.
370LeetCode 370: Range AdditionMediumA clear explanation of applying many range updates efficiently using a difference array and prefix sums.
371LeetCode 371: Sum of Two IntegersMediumA clear explanation of adding two integers without using plus or minus by using XOR, AND, carry, and a 32-bit mask.
372LeetCode 372: Super PowMediumA clear explanation of computing large modular exponentiation using fast power, modular arithmetic, and digit decomposition.
373LeetCode 373: Find K Pairs with Smallest SumsMediumA clear explanation of finding the k smallest pair sums from two sorted arrays using a min heap and best-first search.
374LeetCode 374: Guess Number Higher or LowerEasyA clear explanation of finding the picked number using binary search and the guess API.
375LeetCode 375: Guess Number Higher or Lower IIMediumA clear explanation of finding the minimum guaranteed cost using interval dynamic programming.
376LeetCode 376: Wiggle SubsequenceMediumA clear explanation of the Wiggle Subsequence problem using dynamic programming intuition and an optimized greedy solution.
377LeetCode 377: Combination Sum IVMediumA clear explanation of Combination Sum IV using dynamic programming to count ordered combinations that sum to a target.
378LeetCode 378: Kth Smallest Element in a Sorted MatrixMediumA clear explanation of finding the kth smallest value in a row-sorted and column-sorted matrix using binary search on values.
379LeetCode 379: Design Phone DirectoryMediumA clear explanation of designing a phone directory that can allocate, check, and release numbers efficiently.
380LeetCode 380: Insert Delete GetRandom O(1)MediumA clear explanation of designing a randomized set with average O(1) insert, remove, and getRandom operations.
381LeetCode 381: Insert Delete GetRandom O(1) - Duplicates AllowedHardA clear explanation of designing a randomized multiset with average O(1) insert, remove, and getRandom operations.
382LeetCode 382: Linked List Random NodeMediumA clear explanation of selecting a random linked list node with equal probability using reservoir sampling.
383LeetCode 383: Ransom NoteEasyA clear explanation of checking whether one string can be constructed from another using character frequency counting.
384LeetCode 384: Shuffle an ArrayMediumA clear explanation of shuffling an array uniformly using the Fisher-Yates algorithm while supporting reset.
385LeetCode 385: Mini ParserMediumA clear explanation of parsing a serialized nested integer string using a stack.
386LeetCode 386: Lexicographical NumbersMediumA clear explanation of generating numbers from 1 to n in lexicographical order using an iterative DFS-style traversal.
387LeetCode 387: First Unique Character in a StringEasyA clear explanation of finding the first non-repeating character in a string using character frequency counting.
388LeetCode 388: Longest Absolute File PathMediumA clear explanation of computing the longest absolute path to a file from a serialized file system string using path lengths by depth.
389LeetCode 389: Find the DifferenceEasyA clear explanation of finding the extra character added to a shuffled string using counting and XOR.
390LeetCode 390: Elimination GameMediumA clear explanation of finding the last remaining number after alternating left-to-right and right-to-left eliminations.
391LeetCode 391: Perfect RectangleHardA clear explanation of checking whether many small axis-aligned rectangles form one exact rectangular cover using area and corner parity.
392LeetCode 392: Is SubsequenceEasyA clear explanation of checking whether one string is a subsequence of another using two pointers.
393LeetCode 393: UTF-8 ValidationMediumA clear explanation of validating a byte sequence as UTF-8 using bit masks and a continuation-byte counter.
394LeetCode 394: Decode StringMediumA clear explanation of decoding nested repeat expressions using a stack.
395LeetCode 395: Longest Substring with At Least K Repeating CharactersMediumA clear explanation of finding the longest substring where every character appears at least k times using divide and conquer.
396LeetCode 396: Rotate FunctionMediumA clear explanation of maximizing the rotation function using a recurrence instead of simulating every rotation.
397LeetCode 397: Integer ReplacementMediumA clear explanation of reducing an integer to 1 with the fewest operations using greedy bit decisions.
398LeetCode 398: Random Pick IndexMediumA clear explanation of picking a uniformly random index for a target value using reservoir sampling, with an alternative hash map approach.
399LeetCode 399: Evaluate DivisionMediumA clear explanation of solving division equations using graph traversal and weighted edges.
400LeetCode 400: Nth DigitMediumA clear explanation of finding the nth digit in the infinite integer sequence using digit groups and arithmetic.
401LeetCode 401: Binary WatchEasyA clear explanation of the Binary Watch problem using bit counting over all valid times.
402LeetCode 402: Remove K DigitsMediumA clear explanation of the Remove K Digits problem using a greedy monotonic stack.
403LeetCode 403: Frog JumpHardA clear explanation of the Frog Jump problem using dynamic programming with reachable jump sizes.
404LeetCode 404: Sum of Left LeavesEasyA clear explanation of the Sum of Left Leaves problem using depth-first traversal of a binary tree.
405LeetCode 405: Convert a Number to HexadecimalEasyA clear explanation of converting integers to hexadecimal using bit manipulation and two’s complement representation.
406LeetCode 406: Queue Reconstruction by HeightMediumA clear explanation of reconstructing a queue using greedy sorting and indexed insertion.
407LeetCode 407: Trapping Rain Water IIHardA clear explanation of trapping rain water in a 2D elevation map using a min heap and boundary expansion.
408LeetCode 408: Valid Word AbbreviationEasyA clear explanation of validating a word abbreviation using two pointers and number parsing.
409LeetCode 409: Longest PalindromeEasyA clear explanation of finding the longest palindrome length that can be built from given letters using character counts.
410LeetCode 410: Split Array Largest SumHardA clear explanation of minimizing the largest subarray sum using binary search on the answer and greedy validation.
411LeetCode 411: Minimum Unique Word AbbreviationHardA clear explanation of finding the shortest abbreviation that does not conflict with any dictionary word using bit masks.
412LeetCode 412: Fizz BuzzEasyA clear explanation of the Fizz Buzz problem using direct simulation and divisibility checks.
413LeetCode 413: Arithmetic SlicesMediumA clear explanation of counting arithmetic subarrays using dynamic programming and consecutive differences.
414LeetCode 414: Third Maximum NumberEasyA clear explanation of finding the third distinct maximum number using one pass and constant space.
415LeetCode 415: Add StringsEasyA clear explanation of adding two non-negative integer strings using manual digit-by-digit simulation.
416LeetCode 416: Partition Equal Subset SumMediumA clear explanation of deciding whether an array can be split into two equal-sum subsets using 0/1 knapsack dynamic programming.
417LeetCode 417: Pacific Atlantic Water FlowMediumA clear explanation of finding cells that can flow to both oceans using reverse graph traversal from the borders.
418LeetCode 418: Sentence Screen FittingMediumA clear explanation of fitting a sentence onto a screen using cyclic string simulation and greedy row transitions.
419LeetCode 419: Battleships in a BoardMediumA clear explanation of counting battleships in a board using one-pass observation without modifying the grid.
420LeetCode 420: Strong Password CheckerHardA clear explanation of checking the minimum edits needed to make a password strong using greedy handling of length, missing character types, and repeated runs.
421LeetCode 421: Maximum XOR of Two Numbers in an ArrayMediumA clear explanation of finding the maximum XOR of two numbers using greedy bit prefixes.
422LeetCode 422: Valid Word SquareEasyA clear explanation of checking whether rows and columns read the same using direct index comparison.
423LeetCode 423: Reconstruct Original Digits from EnglishMediumA clear explanation of reconstructing digits from shuffled English words using character frequency counts and unique identifying letters.
424LeetCode 424: Longest Repeating Character ReplacementMediumA clear explanation of finding the longest substring that can become all one letter using a sliding window.
425LeetCode 425: Word SquaresHardA clear explanation of building all word squares using backtracking with prefix pruning.
426LeetCode 426: Convert Binary Search Tree to Sorted Doubly Linked ListMediumConvert a BST into a sorted circular doubly linked list in-place using inorder traversal.
427LeetCode 427: Construct Quad TreeMediumBuild a quad tree from a binary square grid using recursive divide and conquer.
428LeetCode 428: Serialize and Deserialize N-ary TreeHardSerialize an N-ary tree into a string and reconstruct the same tree using preorder traversal with child counts.
429LeetCode 429: N-ary Tree Level Order TraversalMediumTraverse an N-ary tree level by level using breadth-first search.
430LeetCode 430: Flatten a Multilevel Doubly Linked ListMediumFlatten a multilevel doubly linked list in-place using depth-first traversal and pointer splicing.
431LeetCode 431: Encode N-ary Tree to Binary TreeHardConvert an N-ary tree into a binary tree and reconstruct it using the left-child right-sibling representation.
432LeetCode 432: All O’one Data StructureHardDesign a data structure that supports increment, decrement, get minimum key, and get maximum key in average O(1) time.
433LeetCode 433: Minimum Genetic MutationMediumFind the minimum number of valid one-character gene mutations using breadth-first search.
434LeetCode 434: Number of Segments in a StringEasyCount the number of word segments in a string by detecting transitions from spaces to non-space characters.
435LeetCode 435: Non-overlapping IntervalsMediumRemove the minimum number of intervals so the remaining intervals do not overlap, using greedy sorting by end time.
436LeetCode 436: Find Right IntervalMediumFind, for each interval, the interval with the smallest start point greater than or equal to its end point using sorting and binary search.
437LeetCode 437: Path Sum IIIMediumCount downward paths in a binary tree whose values sum to targetSum using DFS and prefix sums.
438LeetCode 438: Find All Anagrams in a StringMediumFind all starting indices where an anagram of p appears in s using a fixed-size sliding window.
439LeetCode 439: Ternary Expression ParserMediumEvaluate a nested ternary expression using a right-to-left stack parser.
440LeetCode 440: K-th Smallest in Lexicographical OrderHardFind the k-th integer in lexicographical order without generating all numbers, using prefix counting over a conceptual trie.
441LeetCode 441: Arranging CoinsEasyFind the maximum number of complete staircase rows that can be formed using binary search and triangular numbers.
442LeetCode 442: Find All Duplicates in an ArrayMediumFind all duplicated numbers in an array in O(n) time and O(1) extra space using index marking.
443LeetCode 443: String CompressionMediumCompress a character array in-place using two pointers and grouped character counting.
444LeetCode 444: Sequence ReconstructionMediumCheck whether nums is the unique shortest supersequence of given subsequences using topological sorting.
445LeetCode 445: Add Two Numbers IIMediumAdd two numbers stored in forward-order linked lists using stacks and carry propagation.
446LeetCode 446: Arithmetic Slices II - SubsequenceHardCount arithmetic subsequences of length at least three using dynamic programming with one hash map per ending index.
447LeetCode 447: Number of BoomerangsMediumCount ordered boomerang tuples by fixing each point as the center and grouping other points by squared distance.
448LeetCode 448: Find All Numbers Disappeared in an ArrayEasyFind all missing numbers from 1 to n in O(n) time using in-place index marking.
449LeetCode 449: Serialize and Deserialize BSTMediumSerialize a binary search tree compactly with preorder traversal and rebuild it using BST value bounds.
450LeetCode 450: Delete Node in a BSTMediumDelete a node from a binary search tree while preserving the BST property using recursive search and inorder successor replacement.
451LeetCode 451: Sort Characters By FrequencyMediumA clear explanation of sorting characters by decreasing frequency using a hash map and sorting.
452LeetCode 452: Minimum Number of Arrows to Burst BalloonsMediumA clear explanation of the greedy interval solution for finding the minimum number of arrows needed to burst all balloons.
453LeetCode 453: Minimum Moves to Equal Array ElementsMediumA clear explanation of the math behind making all array elements equal by incrementing n - 1 elements at a time.
454LeetCode 454: 4Sum IIMediumA clear explanation of counting zero-sum tuples across four arrays using pair sums and a hash map.
455LeetCode 455: Assign CookiesEasyA clear explanation of the greedy two-pointer solution for maximizing the number of content children.
456LeetCode 456: 132 PatternMediumA clear explanation of detecting a 132 pattern using reverse traversal and a monotonic stack.
457LeetCode 457: Circular Array LoopMediumA clear explanation of detecting a valid cycle in a circular array using fast and slow pointers.
458LeetCode 458: Poor PigsHardA clear explanation of the combinatorics behind finding the minimum number of pigs needed to identify the poisonous bucket.
459LeetCode 459: Repeated Substring PatternEasyA clear explanation of checking whether a string can be built by repeating one of its proper substrings.
460LeetCode 460: LFU CacheHardA clear explanation of designing an LFU cache with O(1) average get and put operations.
461LeetCode 461: Hamming DistanceEasyA clear explanation of computing the Hamming distance between two integers using XOR and bit counting.
462LeetCode 462: Minimum Moves to Equal Array Elements IIMediumA clear explanation of why the median minimizes the number of moves needed to make all array elements equal.
463LeetCode 463: Island PerimeterEasyA clear explanation of counting the perimeter of an island in a grid by adding land-cell edges and subtracting shared edges.
464LeetCode 464: Can I WinMediumA clear explanation of solving the Can I Win game using minimax recursion, bitmask state compression, and memoization.
465LeetCode 465: Optimal Account BalancingHardA clear explanation of minimizing debt-settlement transactions using net balances, backtracking, and memoization-style pruning.
466LeetCode 466: Count The RepetitionsHardA clear explanation of counting how many repeated copies of one string can be obtained as a subsequence of another repeated string.
467LeetCode 467: Unique Substrings in Wraparound StringMediumA clear explanation of counting unique substrings that appear in the infinite alphabet wraparound string using dynamic programming by ending character.
468LeetCode 468: Validate IP AddressMediumA clear explanation of validating IPv4 and IPv6 addresses by checking segment count, length, characters, range, and leading-zero rules.
469LeetCode 469: Convex PolygonMediumA clear explanation of checking whether ordered points form a convex polygon using cross products.
470LeetCode 470: Implement Rand10() Using Rand7()MediumA clear explanation of generating a uniform random integer from 1 to 10 using only rand7 and rejection sampling.
471LeetCode 471: Encode String with Shortest LengthHardA clear explanation of interval dynamic programming for encoding a string into the shortest k[encoded_string] form.
472LeetCode 472: Concatenated WordsHardA clear explanation of finding all words that can be formed by concatenating at least two shorter words from the same list.
473LeetCode 473: Matchsticks to SquareMediumA clear explanation of deciding whether matchsticks can form a square using backtracking, sorting, and pruning.
474LeetCode 474: Ones and ZeroesMediumA clear explanation of solving the largest subset problem as a two-dimensional 0/1 knapsack over zero and one counts.
475LeetCode 475: HeatersMediumA clear explanation of finding the minimum heater radius by sorting positions and matching each house to its nearest heater.
476LeetCode 476: Number ComplementEasyA clear explanation of finding the bitwise complement of a positive integer using a binary mask.
477LeetCode 477: Total Hamming DistanceMediumA clear explanation of computing the total Hamming distance across all pairs by counting different bits column by column.
478LeetCode 478: Generate Random Point in a CircleMediumA clear explanation of generating uniformly random points inside a circle using polar coordinates.
479LeetCode 479: Largest Palindrome ProductHardA clear explanation of finding the largest palindrome made from the product of two n-digit numbers by generating palindrome candidates directly.
480LeetCode 480: Sliding Window MedianHardA clear explanation of maintaining the median of each fixed-size window using two heaps and lazy deletion.
481LeetCode 481: Magical StringMediumA clear explanation of constructing the magical string by using the string itself as run-length instructions.
482LeetCode 482: License Key FormattingEasyA clear explanation of reformatting a license key by removing dashes, uppercasing characters, and grouping from the right.
483LeetCode 483: Smallest Good BaseHardA clear explanation of finding the smallest base where n is written as all ones using geometric series and binary search.
484LeetCode 484: Find PermutationMediumA clear explanation of constructing the lexicographically smallest permutation that matches an I and D pattern.
485LeetCode 485: Max Consecutive OnesEasyA clear explanation of finding the longest streak of 1s in a binary array with a single pass.
486LeetCode 486: Predict the WinnerMediumA clear explanation of predicting whether Player 1 can win using minimax dynamic programming over score difference.
487LeetCode 487: Max Consecutive Ones IIMediumA clear explanation of finding the longest run of 1s after flipping at most one 0 using a sliding window.
488LeetCode 488: Zuma GameHardA clear explanation of solving Zuma Game with DFS, memoization, and chain-removal simulation.
489LeetCode 489: Robot Room CleanerHardA clear explanation of cleaning an unknown grid using DFS, relative coordinates, and physical backtracking.
490LeetCode 490: The MazeMediumA clear explanation of deciding whether a rolling ball can stop at the destination using BFS or DFS over stopping cells.
491LeetCode 491: Non-decreasing SubsequencesMediumA clear explanation of generating all distinct non-decreasing subsequences using DFS, backtracking, and per-level duplicate control.
492LeetCode 492: Construct the RectangleEasyA clear explanation of finding rectangle dimensions with a fixed area and the smallest length-width difference.
493LeetCode 493: Reverse PairsHardA clear explanation of counting pairs where nums[i] is greater than twice nums[j] using merge sort.
494LeetCode 494: Target SumMediumA clear explanation of counting sign assignments that reach a target using recursion first, then subset-sum dynamic programming.
495LeetCode 495: Teemo AttackingEasyA clear explanation of calculating total poisoned duration by merging overlapping attack intervals.
496LeetCode 496: Next Greater Element IEasyA clear explanation of finding the next greater element using a monotonic decreasing stack and hash map.
497LeetCode 497: Random Point in Non-overlapping RectanglesMediumA clear explanation of uniformly picking an integer point from non-overlapping rectangles using prefix sums and binary search.
498LeetCode 498: Diagonal TraverseMediumA clear explanation of returning matrix elements in diagonal zigzag order by grouping cells with the same row plus column index.
499LeetCode 499: The Maze IIIHardA clear explanation of finding the shortest rolling-ball path to the hole using Dijkstra with lexicographic tie-breaking.
500LeetCode 500: Keyboard RowEasyA clear explanation of filtering words that can be typed using only one row of an American keyboard.
501LeetCode 501: Find Mode in Binary Search TreeEasyA clear explanation of finding the most frequent value or values in a binary search tree using inorder traversal.
502LeetCode 502: IPOHardA clear explanation of maximizing capital by selecting at most k projects using sorting and a max heap.
503LeetCode 503: Next Greater Element IIMediumA clear explanation of finding the next greater element in a circular array using a monotonic stack.
504LeetCode 504: Base 7EasyA clear explanation of converting an integer into its base 7 string representation using repeated division.
505LeetCode 505: The Maze IIMediumA clear explanation of finding the shortest rolling distance in a maze using Dijkstra’s algorithm.
506LeetCode 506: Relative RanksEasyA clear explanation of assigning athlete ranks from scores using sorting while preserving original indices.
507LeetCode 507: Perfect NumberEasyA clear explanation of checking whether a number equals the sum of its positive divisors excluding itself.
508LeetCode 508: Most Frequent Subtree SumMediumA clear explanation of finding the most frequent subtree sum in a binary tree using postorder DFS and a frequency map.
509LeetCode 509: Fibonacci NumberEasyA clear explanation of computing Fibonacci numbers using dynamic programming and iterative state transitions.
510LeetCode 510: Inorder Successor in BST IIMediumA clear explanation of finding the inorder successor in a binary search tree when nodes contain parent pointers.
511LeetCode 511: Game Play Analysis IEasyA clear explanation of finding each player’s first login date using SQL aggregation.
512LeetCode 512: Game Play Analysis IIEasyA clear explanation of finding the first device used by each player using SQL aggregation and a join.
513LeetCode 513: Find Bottom Left Tree ValueMediumA clear explanation of finding the leftmost value in the deepest row of a binary tree using level-order traversal.
514LeetCode 514: Freedom TrailHardA clear explanation of finding the minimum steps to spell a key on a circular ring using dynamic programming and memoized DFS.
515LeetCode 515: Find Largest Value in Each Tree RowMediumA clear explanation of finding the maximum value at every depth of a binary tree using level-order traversal.
516LeetCode 516: Longest Palindromic SubsequenceMediumA clear explanation of finding the length of the longest palindromic subsequence using interval dynamic programming.
517LeetCode 517: Super Washing MachinesHardA clear explanation of balancing dresses across washing machines using greedy prefix flow.
518LeetCode 518: Coin Change IIMediumA clear explanation of counting coin-change combinations using dynamic programming.
519LeetCode 519: Random Flip MatrixMediumA clear explanation of randomly flipping zero cells in a matrix without repetition using hash mapping and virtual swapping.
520LeetCode 520: Detect CapitalEasyA clear explanation of checking whether a word uses capital letters correctly by counting uppercase letters.
521LeetCode 521: Longest Uncommon Subsequence IEasyA clear explanation of finding the longest uncommon subsequence between two strings using simple case analysis.
522LeetCode 522: Longest Uncommon Subsequence IIMediumA clear explanation of finding the longest uncommon subsequence among many strings using subsequence checks.
523LeetCode 523: Continuous Subarray SumMediumA clear explanation of detecting a subarray whose sum is a multiple of k using prefix sums and modular arithmetic.
524LeetCode 524: Longest Word in Dictionary through DeletingMediumA clear explanation of finding the longest dictionary word obtainable as a subsequence using two pointers and sorting rules.
525LeetCode 525: Contiguous ArrayMediumA clear explanation of finding the longest contiguous subarray with equal numbers of 0 and 1 using prefix sums and a hash map.
526LeetCode 526: Beautiful ArrangementMediumA clear explanation of counting beautiful arrangements using backtracking and divisibility pruning.
527LeetCode 527: Word AbbreviationHardA clear explanation of generating minimal unique word abbreviations using grouping and trie prefixes.
528LeetCode 528: Random Pick with WeightMediumA clear explanation of weighted random sampling using prefix sums and binary search.
529LeetCode 529: MinesweeperMediumA clear explanation of updating a Minesweeper board using DFS flood fill and adjacent mine counting.
530LeetCode 530: Minimum Absolute Difference in BSTEasyA clear explanation of finding the minimum difference between two BST node values using inorder traversal.
531LeetCode 531: Lonely Pixel IMediumA clear explanation of counting black pixels that are alone in both their row and column.
532LeetCode 532: K-diff Pairs in an ArrayMediumA clear explanation of counting unique pairs whose absolute difference is k using frequency counting.
533LeetCode 533: Lonely Pixel IIMediumA clear explanation of counting black lonely pixels using row counts, column counts, and duplicate row patterns.
534LeetCode 534: Game Play Analysis IIIMediumA clear explanation of computing cumulative games played per player and date using SQL window functions.
535LeetCode 535: Encode and Decode TinyURLMediumA clear explanation of designing a simple URL encoder and decoder using a hash map and generated keys.
536LeetCode 536: Construct Binary Tree from StringMediumA clear explanation of parsing a parenthesized string recursively to construct a binary tree.
537LeetCode 537: Complex Number MultiplicationMediumA clear explanation of multiplying complex numbers represented as strings using algebraic expansion.
538LeetCode 538: Convert BST to Greater TreeMediumA clear explanation of converting a BST into a greater tree using reverse inorder traversal and a running sum.
539LeetCode 539: Minimum Time DifferenceMediumA clear explanation of finding the minimum difference between 24-hour clock times using minute conversion and sorting.
540LeetCode 540: Single Element in a Sorted ArrayMediumA clear explanation of finding the only non-duplicate element in a sorted array using binary search.
541LeetCode 541: Reverse String IIEasyA clear explanation of reversing the first k characters in every 2k block of a string.
542LeetCode 542: 01 MatrixMediumA clear explanation of computing the distance to the nearest zero in a binary matrix using multi-source BFS.
543LeetCode 543: Diameter of Binary TreeEasyA clear explanation of finding the longest path between any two nodes in a binary tree using DFS height computation.
544LeetCode 544: Output Contest MatchesMediumA clear explanation of building the final tournament bracket by repeatedly pairing strongest and weakest teams.
545LeetCode 545: Boundary of Binary TreeMediumA clear explanation of collecting the boundary of a binary tree using separate left boundary, leaves, and right boundary traversals.
546LeetCode 546: Remove BoxesHardA clear explanation of maximizing remove-box scores using interval dynamic programming with memoization.
547LeetCode 547: Number of ProvincesMediumA clear explanation of counting connected components in an undirected graph represented by an adjacency matrix.
548LeetCode 548: Split Array with Equal SumHardA clear explanation of splitting an array into four equal-sum parts using prefix sums and set-based search.
549LeetCode 549: Binary Tree Longest Consecutive Sequence IIMediumA clear explanation of finding the longest increasing or decreasing consecutive path in a binary tree using DFS.
550LeetCode 550: Game Play Analysis IVMediumA clear explanation of calculating the fraction of players who logged in again the day after their first login.
551LeetCode 551: Student Attendance Record IEasyA clear explanation of Student Attendance Record I using simple string checks and a one-pass counter solution.
552LeetCode 552: Student Attendance Record IIHardA clear explanation of Student Attendance Record II using dynamic programming over absence count and late streak.
553LeetCode 553: Optimal DivisionMediumA clear explanation of Optimal Division using the structure of division expressions to build the maximum-value expression.
554LeetCode 554: Brick WallMediumA clear explanation of Brick Wall using prefix sums and a hash map to find the best vertical cut position.
555LeetCode 555: Split Concatenated StringsMediumA clear explanation of Split Concatenated Strings using string reversal choices and enumeration of every possible cut point.
556LeetCode 556: Next Greater Element IIIMediumA clear explanation of Next Greater Element III using the next permutation algorithm on the digits of an integer.
557LeetCode 557: Reverse Words in a String IIIEasyA clear explanation of Reverse Words in a String III using two-pointer scanning and string reversal.
558LeetCode 558: Logical OR of Two Binary Grids Represented as Quad-TreesMediumA clear explanation of merging two quad-trees using recursive logical OR operations.
559LeetCode 559: Maximum Depth of N-ary TreeEasyA clear explanation of Maximum Depth of N-ary Tree using recursive depth-first search.
560LeetCode 560: Subarray Sum Equals KMediumA clear explanation of Subarray Sum Equals K using prefix sums and a hash map to count matching subarrays in linear time.
561LeetCode 561: Array PartitionEasyA clear explanation of Array Partition using sorting and adjacent pairing to maximize the sum of pair minimums.
562LeetCode 562: Longest Line of Consecutive One in MatrixMediumA clear explanation of Longest Line of Consecutive One in Matrix using dynamic programming over four directions.
563LeetCode 563: Binary Tree TiltEasyA clear explanation of Binary Tree Tilt using postorder DFS to compute subtree sums and accumulate tilt.
564LeetCode 564: Find the Closest PalindromeHardA clear explanation of Find the Closest Palindrome using prefix mirroring and a small candidate set.
565LeetCode 565: Array NestingMediumA clear explanation of Array Nesting using cycle detection over a permutation.
566LeetCode 566: Reshape the MatrixEasyA clear explanation of Reshape the Matrix using index mapping from the original matrix to the reshaped matrix.
567LeetCode 567: Permutation in StringMediumA clear explanation of Permutation in String using a fixed-size sliding window and character frequency counts.
568LeetCode 568: Maximum Vacation DaysHardA clear explanation of Maximum Vacation Days using dynamic programming over weeks and cities.
569LeetCode 569: Median Employee SalaryHardA clear explanation of Median Employee Salary using SQL window functions to rank employees inside each company.
570LeetCode 570: Managers with at Least 5 Direct ReportsMediumA clear explanation of Managers with at Least 5 Direct Reports using grouping and a self join.
571LeetCode 571: Find Median Given Frequency of NumbersHardA clear explanation of Find Median Given Frequency of Numbers using cumulative frequency and SQL window functions.
572LeetCode 572: Subtree of Another TreeEasyA clear explanation of Subtree of Another Tree using recursive tree matching and DFS.
573LeetCode 573: Squirrel SimulationMediumA clear explanation of Squirrel Simulation using Manhattan distance and the special first trip.
574LeetCode 574: Winning CandidateMediumA clear explanation of Winning Candidate using SQL aggregation to count votes and return the candidate with the most votes.
575LeetCode 575: Distribute CandiesEasyA clear explanation of Distribute Candies using a set to count candy types and a simple limit argument.
576LeetCode 576: Out of Boundary PathsMediumA clear dynamic programming solution for counting paths that move a ball out of a grid boundary.
577LeetCode 577: Employee BonusEasyA clear SQL guide for finding employees whose bonus is less than 1000 or missing.
578LeetCode 578: Get Highest Answer Rate QuestionMediumA clear SQL guide for finding the question with the highest answer rate from survey logs.
579LeetCode 579: Find Cumulative Salary of an EmployeeHardA clear SQL guide for computing each employee’s 3-month cumulative salary while excluding their most recent month.
580LeetCode 580: Count Student Number in DepartmentsMediumA clear SQL guide for counting students in every department, including departments with zero students.
581LeetCode 581: Shortest Unsorted Continuous SubarrayMediumA clear linear-time solution for finding the shortest subarray that must be sorted to make the whole array sorted.
582LeetCode 582: Kill ProcessMediumA clear graph traversal solution for finding all processes terminated when killing a target process.
583LeetCode 583: Delete Operation for Two StringsMediumA clear dynamic programming solution for finding the minimum deletions needed to make two strings equal.
584LeetCode 584: Find Customer RefereeEasyA clear SQL guide for selecting customers who were not referred by customer 2, including customers with no referee.
585LeetCode 585: Investments in 2016MediumA clear SQL guide for summing 2016 investments for policies with repeated 2015 investment values and unique locations.
586LeetCode 586: Customer Placing the Largest Number of OrdersEasyA clear SQL guide for finding the customer who placed the most orders.
587LeetCode 587: Erect the FenceHardA clear convex hull solution for returning all trees that lie on the fence boundary.
588LeetCode 588: Design In-Memory File SystemHardA clear design guide for implementing an in-memory file system with directory listing, directory creation, file append, and file read operations.
589LeetCode 589: N-ary Tree Preorder TraversalEasyA clear DFS solution for returning the preorder traversal of an N-ary tree.
590LeetCode 590: N-ary Tree Postorder TraversalEasyA clear DFS solution for returning the postorder traversal of an N-ary tree.
591LeetCode 591: Tag ValidatorHardA clear stack-based parser for validating nested XML-like tags with CDATA sections.
592LeetCode 592: Fraction Addition and SubtractionMediumA clear parsing and math solution for evaluating fraction addition and subtraction expressions.
593LeetCode 593: Valid SquareMediumA clear geometry solution for checking whether four unordered points form a valid square.
594LeetCode 594: Longest Harmonious SubsequenceEasyA clear hash map solution for finding the longest subsequence whose maximum and minimum differ by exactly one.
595LeetCode 595: Big CountriesEasyA clear SQL guide for finding countries with either large area or large population.
596LeetCode 596: Classes With at Least 5 StudentsEasyA clear SQL guide for finding classes that have at least five students.
597LeetCode 597: Friend Requests I: Overall Acceptance RateEasyA clear SQL guide for computing the overall friend request acceptance rate with duplicate pairs counted once.
598LeetCode 598: Range Addition IIEasyA clear math solution for counting the maximum values after repeated top-left matrix increment operations.
599LeetCode 599: Minimum Index Sum of Two ListsEasyA clear hash map solution for finding common strings with the smallest index sum.
600LeetCode 600: Non-negative Integers without Consecutive OnesHardA clear digit dynamic programming solution for counting numbers whose binary representation does not contain consecutive ones.
601LeetCode 601: Human Traffic of StadiumHardA SQL guide for finding stadium records that belong to runs of at least three consecutive ids where each row has at least 100 people.
602LeetCode 602: Friend Requests II: Who Has the Most FriendsMediumA SQL guide for counting friendships from both requester and accepter sides, then returning the user with the most friends.
603LeetCode 603: Consecutive Available SeatsEasyA SQL guide for finding all cinema seats that are free and adjacent to at least one other free seat.
604LeetCode 604: Design Compressed String IteratorEasyA guide to implementing a lazy iterator over a run-length encoded string without fully decompressing it.
605LeetCode 605: Can Place FlowersEasyA greedy guide for determining whether a given number of flowers can be planted without violating the no-adjacent-flowers rule.
606LeetCode 606: Construct String from Binary TreeEasyA recursive guide for converting a binary tree into a preorder parenthesized string while preserving the one-to-one mapping between the tree and the string.
607LeetCode 607: Sales PersonEasyA SQL guide for finding salespeople who never had an order related to the company named RED.
608LeetCode 608: Tree NodeMediumA SQL guide for classifying binary tree nodes as Root, Inner, or Leaf based on parent-child relationships.
609LeetCode 609: Find Duplicate File in SystemMediumA hash map guide for grouping file paths by identical file content and returning only duplicate groups.
610LeetCode 610: Triangle JudgementEasyA SQL guide for checking whether three side lengths can form a valid triangle using the triangle inequality.
611LeetCode 611: Valid Triangle NumberMediumA two-pointer guide for counting triplets that can form valid triangles after sorting the side lengths.
612LeetCode 612: Shortest Distance in a PlaneMediumA SQL guide for finding the minimum Euclidean distance between any two points in a 2D plane.
613LeetCode 613: Shortest Distance in a LineEasyA SQL guide for finding the minimum distance between any two unique points on the X-axis.
614LeetCode 614: Second Degree FollowerMediumA SQL guide for finding users who both follow someone and have followers, then counting how many followers they have.
615LeetCode 615: Average Salary: Departments VS CompanyHardA SQL guide for comparing each department’s monthly average salary against the company’s monthly average salary.
616LeetCode 616: Add Bold Tag in StringMediumA string-marking guide for adding bold tags around all matched words while merging overlapping and adjacent bold regions.
617LeetCode 617: Merge Two Binary TreesEasyA recursive tree traversal guide for merging two binary trees node by node.
618LeetCode 618: Students Report By GeographyHardA SQL guide for pivoting rows into columns using ranking and conditional aggregation.
619LeetCode 619: Biggest Single NumberEasyA SQL guide for finding the largest number that appears exactly once in a table.
620LeetCode 620: Not Boring MoviesEasyA SQL guide for filtering movies with odd IDs and non-boring descriptions, then sorting by rating.
621LeetCode 621: Task SchedulerMediumA clear explanation of Task Scheduler using frequency counting and the greedy block formula.
622LeetCode 622: Design Circular QueueMediumA clear explanation of Design Circular Queue using a fixed array, a front pointer, and a size counter.
623LeetCode 623: Add One Row to TreeMediumA clear explanation of Add One Row to Tree using tree traversal and careful subtree reconnection.
624LeetCode 624: Maximum Distance in ArraysMediumA clear explanation of Maximum Distance in Arrays using sorted endpoints and a greedy scan.
625LeetCode 625: Minimum FactorizationMediumA clear explanation of Minimum Factorization using greedy digit factors from 9 down to 2.
626LeetCode 626: Exchange SeatsMediumA SQL solution for swapping every pair of adjacent student seats while leaving the final seat unchanged when the row count is odd.
627LeetCode 627: Swap SalaryEasyA SQL update solution for swapping all m and f values in the Salary table using a single statement.
628LeetCode 628: Maximum Product of Three NumbersEasyA clear explanation of finding the largest product of three numbers using sorting or constant-space tracking.
629LeetCode 629: K Inverse Pairs ArrayHardA dynamic programming solution for counting permutations of 1 to n with exactly k inverse pairs.
630LeetCode 630: Course Schedule IIIHardA greedy heap solution for taking the maximum number of courses before their deadlines.
631LeetCode 631: Design Excel Sum FormulaHardA design solution for a small Excel-like spreadsheet that supports set, get, and dynamic sum formulas.
632LeetCode 632: Smallest Range Covering Elements from K ListsHardA heap-based solution for finding the smallest range that contains at least one number from each sorted list.
633LeetCode 633: Sum of Square NumbersMediumA two-pointer and number theory solution for checking whether an integer can be written as the sum of two square numbers.
634LeetCode 634: Find the Derangement of An ArrayMediumA dynamic programming and combinatorics solution for counting permutations with no fixed positions.
635LeetCode 635: Design Log Storage SystemMediumA design solution for storing timestamped logs and retrieving IDs by inclusive time range at a chosen granularity.
636LeetCode 636: Exclusive Time of FunctionsMediumA stack-based solution for computing exclusive execution time from nested start and end logs.
637LeetCode 637: Average of Levels in Binary TreeEasyA breadth-first search solution for computing the average value of nodes at each level of a binary tree.
638LeetCode 638: Shopping OffersMediumA DFS and memoization solution for finding the minimum cost to satisfy item needs using individual prices and reusable special offers.
639LeetCode 639: Decode Ways IIHardA dynamic programming solution for counting decodings of a digit string with wildcard characters.
640LeetCode 640: Solve the EquationMediumA string parsing solution for reducing a linear equation into coefficient and constant terms.
641LeetCode 641: Design Circular DequeMediumAn array-based circular buffer solution for implementing a fixed-size double-ended queue.
642LeetCode 642: Design Search Autocomplete SystemHardA trie-based design for returning the top three historical sentences for a typed prefix.
643LeetCode 643: Maximum Average Subarray IEasyA sliding window solution for finding the maximum average among all contiguous subarrays of fixed length k.
644LeetCode 644: Maximum Average Subarray IIHardA binary search solution for finding the maximum average of any contiguous subarray with length at least k.
645LeetCode 645: Set MismatchEasyA counting and math solution for finding the duplicated number and the missing number in a corrupted set.
646LeetCode 646: Maximum Length of Pair ChainMediumA greedy interval scheduling solution for finding the longest chain of valid pairs.
647LeetCode 647: Palindromic SubstringsMediumA center expansion solution for counting every palindromic substring in a string.
648LeetCode 648: Replace WordsMediumA trie-based solution for replacing each derivative word with the shortest matching root.
649LeetCode 649: Dota2 SenateMediumA queue-based simulation for predicting which party wins after senators ban opponents in turn order.
650LeetCode 650: 2 Keys KeyboardMediumA dynamic programming and prime factorization solution for finding the minimum operations needed to produce n characters.
651LeetCode 651: 4 Keys KeyboardMediumA dynamic programming solution for maximizing the number of A characters printed with a limited number of keyboard operations.
652LeetCode 652: Find Duplicate SubtreesMediumA clear explanation of finding duplicate binary tree subtrees using postorder traversal, serialization, and a hash map.
653LeetCode 653: Two Sum IV - Input is a BSTEasyA clear explanation of finding whether two different nodes in a binary search tree sum to a target value.
654LeetCode 654: Maximum Binary TreeMediumA clear explanation of constructing a maximum binary tree recursively using divide and conquer.
655LeetCode 655: Print Binary TreeMediumA clear explanation of formatting a binary tree into a 2D string matrix using tree height and recursive placement.
656LeetCode 656: Coin PathHardA clear explanation of finding the minimum-cost path with bounded jumps, blocked cells, and lexicographic tie-breaking.
657LeetCode 657: Robot Return to OriginEasyA clear explanation of determining whether a robot returns to the origin after executing movement instructions.
658LeetCode 658: Find K Closest ElementsMediumA clear explanation of finding the k closest elements to a target using binary search and a sliding window.
659LeetCode 659: Split Array into Consecutive SubsequencesMediumA clear explanation of deciding whether a sorted array can be split into consecutive subsequences of length at least three.
660LeetCode 660: Remove 9HardA clear explanation of finding the nth positive integer that does not contain the digit 9 using base-9 conversion.
661LeetCode 661: Image SmootherEasyA clear explanation of averaging neighboring pixels in a matrix using direct simulation.
662LeetCode 662: Maximum Width of Binary TreeMediumA clear explanation of computing the maximum width of a binary tree using level-order traversal and complete-tree indices.
663LeetCode 663: Equal Tree PartitionMediumA clear explanation of checking whether a binary tree can be split into two equal-sum trees by removing one edge.
664LeetCode 664: Strange PrinterHardA clear explanation of minimizing printer turns using interval dynamic programming.
665LeetCode 665: Non-decreasing ArrayMediumA clear explanation of checking whether an array can become non-decreasing by modifying at most one element.
666LeetCode 666: Path Sum IVMediumA clear explanation of computing all root-to-leaf path sums from a compact three-digit binary tree encoding.
667LeetCode 667: Beautiful Arrangement IIMediumA clear explanation of constructing an array with exactly k distinct adjacent differences using a greedy pattern.
668LeetCode 668: Kth Smallest Number in Multiplication TableHardA clear explanation of finding the kth smallest value in an m by n multiplication table using binary search on answer.
669LeetCode 669: Trim a Binary Search TreeMediumA clear explanation of trimming a BST so that all remaining node values lie inside a given inclusive range.
670LeetCode 670: Maximum SwapMediumA clear explanation of maximizing an integer by swapping at most two digits once.
671LeetCode 671: Second Minimum Node In a Binary TreeEasyA clear explanation of finding the second minimum value in a special binary tree using DFS.
672LeetCode 672: Bulb Switcher IIMediumA clear explanation of counting possible bulb states after pressing four toggle buttons exactly presses times.
673LeetCode 673: Number of Longest Increasing SubsequenceMediumA clear explanation of counting how many longest strictly increasing subsequences exist using dynamic programming.
674LeetCode 674: Longest Continuous Increasing SubsequenceEasyA clear explanation of finding the longest strictly increasing contiguous subarray using a single scan.
675LeetCode 675: Cut Off Trees for Golf EventHardA clear explanation of cutting trees in increasing height order using repeated BFS on a grid.
676LeetCode 676: Implement Magic DictionaryMediumDesign a dictionary that can check whether a word can match a stored word after changing exactly one character.
677LeetCode 677: Map Sum PairsMediumDesign a map that supports key-value insertion and prefix-sum queries using a hash map and trie.
678LeetCode 678: Valid Parenthesis StringMediumCheck whether a string containing parentheses and wildcard stars can be made valid using a greedy range of possible open counts.
679LeetCode 679: 24 GameHardDetermine whether four numbers can be combined with arithmetic operations and parentheses to produce 24.
680LeetCode 680: Valid Palindrome IIEasyCheck whether a string can become a palindrome after deleting at most one character using two pointers.
681LeetCode 681: Next Closest TimeMediumFind the next valid 24-hour time using only the digits from the current time.
682LeetCode 682: Baseball GameEasySimulate a baseball scoring system using a stack to process operations and compute the final score.
683LeetCode 683: K Empty SlotsHardFind the earliest day when two turned-on bulbs have exactly k turned-off bulbs between them using a sliding window over bloom days.
684LeetCode 684: Redundant ConnectionMediumFind the extra edge in an undirected graph that creates a cycle using Union-Find.
685LeetCode 685: Redundant Connection IIHardFind the directed edge to remove so a graph becomes a rooted tree again, handling both cycles and nodes with two parents.
686LeetCode 686: Repeated String MatchMediumFind the minimum number of times one string must be repeated so another string becomes a substring.
687LeetCode 687: Longest Univalue PathMediumFind the longest path in a binary tree where every node on the path has the same value using depth-first search.
688LeetCode 688: Knight Probability in ChessboardMediumCompute the probability that a knight remains on an n x n chessboard after exactly k random moves using dynamic programming.
689LeetCode 689: Maximum Sum of 3 Non-Overlapping SubarraysHardFind three non-overlapping subarrays of length k with maximum total sum and return the lexicographically smallest starting indices.
690LeetCode 690: Employee ImportanceMediumCompute the total importance of an employee and all direct and indirect subordinates using a hash map and depth-first search.
691LeetCode 691: Stickers to Spell WordHardFind the minimum number of stickers needed to form a target string using top-down dynamic programming with memoization.
692LeetCode 692: Top K Frequent WordsMediumFind the k most frequent words using frequency counting and custom sorting by count and lexicographical order.
693LeetCode 693: Binary Number with Alternating BitsEasyCheck whether every adjacent bit in a positive integer’s binary representation is different.
694LeetCode 694: Number of Distinct IslandsMediumCount unique island shapes in a binary grid using DFS and relative coordinates.
695LeetCode 695: Max Area of IslandMediumFind the largest connected island area in a binary grid using depth-first search.
696LeetCode 696: Count Binary SubstringsEasyCount substrings with equal consecutive groups of 0s and 1s using run lengths.
697LeetCode 697: Degree of an ArrayEasyFind the shortest contiguous subarray with the same degree as the whole array using frequency counts and first occurrence indices.
698LeetCode 698: Partition to K Equal Sum SubsetsMediumDecide whether an array can be divided into k non-empty subsets with equal sums using backtracking and pruning.
699LeetCode 699: Falling SquaresHardSimulate falling squares on a number line and track the maximum stack height after each placement.
700LeetCode 700: Search in a Binary Search TreeEasySearch for a target value in a binary search tree and return the subtree rooted at the matching node.
701LeetCode 701: Insert into a Binary Search TreeMediumA clear explanation of inserting a value into a binary search tree using recursive and iterative traversal.
702LeetCode 702: Search in a Sorted Array of Unknown SizeMediumA clear explanation of searching in a sorted array when the array length is hidden behind an ArrayReader interface.
703LeetCode 703: Kth Largest Element in a StreamEasyA clear explanation of maintaining the kth largest element in a stream using a fixed-size min heap.
704LeetCode 704: Binary SearchEasyA clear explanation of searching for a target in a sorted array using binary search.
705LeetCode 705: Design HashSetEasyA clear explanation of designing a hash set without using built-in hash table libraries.
706LeetCode 706: Design HashMapEasyA clear explanation of designing a hash map without using built-in hash table libraries.
707LeetCode 707: Design Linked ListMediumA clear explanation of implementing a linked list from scratch using nodes, a dummy head, and a size counter.
708LeetCode 708: Insert into a Sorted Circular Linked ListMediumA clear explanation of inserting a value into a sorted circular linked list while preserving the circular sorted order.
709LeetCode 709: To Lower CaseEasyA clear explanation of converting uppercase ASCII letters to lowercase by scanning the string once.
710LeetCode 710: Random Pick with BlacklistHardA clear explanation of selecting a uniformly random integer while excluding blacklisted values using remapping and hashing.
711LeetCode 711: Number of Distinct Islands IIHardA clear explanation of counting distinct island shapes under rotation and reflection using normalization and geometric transformations.
712LeetCode 712: Minimum ASCII Delete Sum for Two StringsMediumA clear explanation of using dynamic programming to minimize the ASCII cost of deletions needed to make two strings equal.
713LeetCode 713: Subarray Product Less Than KMediumA clear explanation of counting contiguous subarrays whose product is less than k using a sliding window.
714LeetCode 714: Best Time to Buy and Sell Stock with Transaction FeeMediumA clear explanation of maximizing stock trading profit with unlimited transactions and a fixed transaction fee using dynamic programming.
715LeetCode 715: Range ModuleHardA clear explanation of designing a range module that can add, query, and remove half-open intervals.
716LeetCode 716: Max StackHardA clear explanation of designing a stack that supports push, pop, top, peekMax, and popMax.
717LeetCode 717: 1-bit and 2-bit CharactersEasyA clear explanation of determining whether the last character must be a one-bit character using greedy parsing.
718LeetCode 718: Maximum Length of Repeated SubarrayMediumA clear explanation of finding the longest common contiguous subarray using dynamic programming.
719LeetCode 719: Find K-th Smallest Pair DistanceHardA clear explanation of finding the kth smallest pair distance using sorting, binary search on the answer, and a two-pointer count.
720LeetCode 720: Longest Word in DictionaryEasyA clear explanation of finding the longest buildable word using sorting and a hash set.
721LeetCode 721: Accounts MergeMediumA clear explanation of merging accounts that share emails using union find and sorted email groups.
722LeetCode 722: Remove CommentsMediumA clear explanation of removing line comments and block comments from source code using a state machine.
723LeetCode 723: Candy CrushMediumA clear explanation of restoring a Candy Crush board to a stable state using repeated marking, crushing, and gravity simulation.
724LeetCode 724: Find Pivot IndexEasyA clear explanation of finding the leftmost pivot index using prefix sums and a running left sum.
725LeetCode 725: Split Linked List in PartsMediumA clear explanation of splitting a linked list into k consecutive parts with sizes as equal as possible.
726LeetCode 726: Number of AtomsHardParse a chemical formula with nested parentheses, atom names, and multipliers using recursive descent.
727LeetCode 727: Minimum Window SubsequenceHardFind the shortest substring of s1 that contains s2 as a subsequence using dynamic programming.
728LeetCode 728: Self Dividing NumbersEasyCheck each number in a range by extracting its digits and testing whether every digit divides the original number.
729LeetCode 729: My Calendar IMediumImplement a calendar that accepts a booking only when it does not overlap with any existing booking.
730LeetCode 730: Count Different Palindromic SubsequencesHardCount distinct non-empty palindromic subsequences using interval dynamic programming and duplicate handling.
731LeetCode 731: My Calendar IIMediumAllow double bookings but reject triple bookings using overlap interval tracking.
732LeetCode 732: My Calendar IIIHardTrack the maximum number of overlapping calendar events using a sweep line difference map.
733LeetCode 733: Flood FillEasyRecolor the connected component containing the starting pixel using depth-first search.
734LeetCode 734: Sentence SimilarityEasyCheck whether two word arrays are sentence-similar using a hash set of symmetric similar word pairs.
735LeetCode 735: Asteroid CollisionMediumSimulate asteroid collisions using a stack that keeps the surviving asteroids in order.
736LeetCode 736: Parse Lisp ExpressionHardEvaluate a Lisp-like expression with integers, variables, let bindings, addition, multiplication, and lexical scope.
737LeetCode 737: Sentence Similarity IIMediumCheck sentence similarity with transitive word relationships using union-find.
738LeetCode 738: Monotone Increasing DigitsMediumFind the largest number less than or equal to n whose digits are monotone increasing using a greedy digit adjustment.
739LeetCode 739: Daily TemperaturesMediumFind how many days each temperature must wait for a warmer future day using a monotonic stack.
740LeetCode 740: Delete and EarnMediumTransform the problem into House Robber dynamic programming by grouping equal values into total points.
741LeetCode 741: Cherry PickupHardMaximize cherries collected on a round trip by converting the problem into two simultaneous forward paths and solving with dynamic programming.
742LeetCode 742: Closest Leaf in a Binary TreeMediumFind the nearest leaf to a target node by converting the tree into an undirected graph and running breadth-first search.
743LeetCode 743: Network Delay TimeMediumFind the time needed for a signal to reach all nodes in a directed weighted graph using Dijkstra’s algorithm.
744LeetCode 744: Find Smallest Letter Greater Than TargetEasyUse binary search to find the smallest character strictly greater than the target with wraparound handling.
745LeetCode 745: Prefix and Suffix SearchHardSupport fast prefix and suffix queries by indexing every prefix-suffix combination with the largest word index.
746LeetCode 746: Min Cost Climbing StairsEasyFind the minimum cost to reach the top of the staircase using dynamic programming.
747LeetCode 747: Largest Number At Least Twice of OthersEasyFind whether the maximum element is at least twice every other element using a single linear scan.
748LeetCode 748: Shortest Completing WordEasyFind the shortest word that contains all required license plate letters using frequency counting.
749LeetCode 749: Contain VirusHardSimulate virus containment by repeatedly quarantining the most dangerous infected region and spreading the remaining regions.
750LeetCode 750: Number Of Corner RectanglesMediumCount axis-aligned rectangles whose four corners are 1 using column-pair frequency counting.
751LeetCode 751: IP to CIDRMediumA clear explanation of converting a range of IPv4 addresses into the shortest list of CIDR blocks using greedy bit manipulation.
752LeetCode 752: Open the LockMediumA clear explanation of solving Open the Lock using breadth-first search over lock states.
753LeetCode 753: Cracking the SafeHardA clear explanation of Cracking the Safe using a de Bruijn sequence and depth-first search over password states.
754LeetCode 754: Reach a NumberMediumA clear explanation of reaching a target on a number line using cumulative sums and parity.
755LeetCode 755: Pour WaterMediumA clear explanation of simulating water droplets over an elevation map by checking left first, then right.
756LeetCode 756: Pyramid Transition MatrixMediumA clear explanation of solving Pyramid Transition Matrix using backtracking and memoization over pyramid rows.
757LeetCode 757: Set Intersection Size At Least TwoHardA clear explanation of solving interval intersection constraints using greedy sorting and minimal point selection.
758LeetCode 758: Bold Words in StringEasyA clear explanation of marking matching substrings and merging overlapping bold ranges.
759LeetCode 759: Employee Free TimeHardA clear explanation of finding common free time by merging all employee busy intervals and returning the gaps.
760LeetCode 760: Find Anagram MappingsEasyA clear explanation of mapping each element in one array to a matching index in its anagram using a hash map.
761LeetCode 761: Special Binary StringHardA clear explanation of making a special binary string lexicographically largest using recursive decomposition and sorting.
762LeetCode 762: Prime Number of Set Bits in Binary RepresentationEasyA clear explanation of counting numbers whose binary representation has a prime number of set bits.
763LeetCode 763: Partition LabelsMediumA clear explanation of partitioning a string into the maximum number of parts so each character appears in at most one part.
764LeetCode 764: Largest Plus SignMediumA clear explanation of finding the largest plus sign in a mined grid using four directional dynamic programming scans.
765LeetCode 765: Couples Holding HandsHardA clear explanation of minimizing swaps so every couple sits together using greedy position tracking.
766LeetCode 766: Toeplitz MatrixEasyA clear explanation of checking whether every top-left to bottom-right diagonal in a matrix has the same value.
767LeetCode 767: Reorganize StringMediumA clear explanation of rearranging characters so no two adjacent characters are equal using a greedy max heap.
768LeetCode 768: Max Chunks To Make Sorted IIHardA clear explanation of splitting an array into the maximum number of chunks so sorting each chunk gives the fully sorted array.
769LeetCode 769: Max Chunks To Make SortedMediumA clear explanation of splitting a permutation into the maximum number of chunks using prefix maximums.
770LeetCode 770: Basic Calculator IVHardA clear explanation of simplifying algebraic expressions by parsing, substituting variables, and combining polynomial terms.
771LeetCode 771: Jewels and StonesEasyA clear explanation of counting how many stones are jewels using a hash set for fast membership checks.
772LeetCode 772: Basic Calculator IIIHardA clear explanation of evaluating arithmetic expressions with parentheses, precedence, and integer division.
773LeetCode 773: Sliding PuzzleHardA clear explanation of solving the 2 x 3 sliding puzzle using breadth-first search over board states.
774LeetCode 774: Minimize Max Distance to Gas StationHardA clear explanation of minimizing the largest adjacent gas-station distance using binary search on the answer.
775LeetCode 775: Global and Local InversionsMediumA clear explanation of checking whether every global inversion is also a local inversion using distance constraints.
776LeetCode 776: Split BSTMediumA clear explanation of splitting a binary search tree into two BSTs using recursion and pointer rewiring.
777LeetCode 777: Swap Adjacent in LR StringMediumA clear explanation of validating string transformation using two pointers and movement constraints.
778LeetCode 778: Swim in Rising WaterHardA clear explanation of finding the minimum time to reach the bottom-right cell using a priority queue and minimax path reasoning.
779LeetCode 779: K-th Symbol in GrammarMediumA clear explanation of finding the kth symbol in the grammar sequence using recursion and the parent-child relationship.
780LeetCode 780: Reaching PointsHardA clear explanation of checking whether one point can reach another by working backward with modulo.
781LeetCode 781: Rabbits in ForestMediumA clear explanation of finding the minimum possible number of rabbits using counting and greedy grouping.
782LeetCode 782: Transform to ChessboardHardA clear explanation of transforming a binary board into a chessboard using feasibility checks and minimum row and column swaps.
783LeetCode 783: Minimum Distance Between BST NodesEasyA clear explanation of finding the minimum difference between any two nodes in a BST using inorder traversal.
784LeetCode 784: Letter Case PermutationMediumA clear explanation of generating all strings formed by independently changing each letter to lowercase or uppercase.
785LeetCode 785: Is Graph Bipartite?MediumA clear explanation of checking whether an undirected graph can be split into two independent sets using graph coloring.
786LeetCode 786: K-th Smallest Prime FractionMediumA clear explanation of finding the kth smallest fraction from a sorted array using a min-heap.
787LeetCode 787: Cheapest Flights Within K StopsMediumA clear explanation of finding the cheapest flight route with at most k stops using bounded Bellman-Ford relaxation.
788LeetCode 788: Rotated DigitsMediumA clear explanation of counting good numbers after rotating every digit by 180 degrees.
789LeetCode 789: Escape The GhostsMediumA clear explanation of deciding whether escape is possible by comparing Manhattan distances to the target.
790LeetCode 790: Domino and Tromino TilingMediumA clear explanation of counting tilings of a 2 x n board using dominoes and L-shaped trominoes with dynamic programming.
791LeetCode 791: Custom Sort StringMediumA clear explanation of rearranging a string so that selected characters follow a custom order.
792LeetCode 792: Number of Matching SubsequencesMediumA clear explanation of counting how many words are subsequences of a string using waiting queues.
793LeetCode 793: Preimage Size of Factorial Zeroes FunctionHardA clear explanation of finding how many integers have exactly k trailing zeroes in their factorial.
794LeetCode 794: Valid Tic-Tac-Toe StateMediumA clear explanation of validating whether a Tic-Tac-Toe board can occur in a legal game.
795LeetCode 795: Number of Subarrays with Bounded MaximumMediumA clear explanation of counting contiguous subarrays whose maximum value lies inside a given inclusive range.
796LeetCode 796: Rotate StringEasyA clear explanation of checking whether one string can become another by repeated left rotations.
797LeetCode 797: All Paths From Source to TargetMediumA clear explanation of finding every path from node 0 to node n - 1 in a directed acyclic graph using DFS and backtracking.
798LeetCode 798: Smallest Rotation with Highest ScoreHardA clear explanation of finding the smallest rotation with maximum score using a difference array.
799LeetCode 799: Champagne TowerMediumA clear explanation of simulating overflow in a champagne glass pyramid using dynamic programming.
800LeetCode 800: Similar RGB ColorEasyA clear explanation of finding the closest shorthand RGB color by rounding each color channel to the nearest repeated hexadecimal pair.
801LeetCode 801: Minimum Swaps To Make Sequences IncreasingMediumA dynamic programming solution for finding the minimum number of same-index swaps needed to make two arrays strictly increasing.
802LeetCode 802: Find Eventual Safe StatesMediumA graph traversal solution for finding all nodes that cannot reach a directed cycle.
803LeetCode 803: Bricks Falling When HitHardA reverse simulation and union-find solution for counting how many bricks fall after each hit.
804LeetCode 804: Unique Morse Code WordsEasyA set-based solution for counting how many different Morse code transformations appear among a list of words.
805LeetCode 805: Split Array With Same AverageHardA dynamic programming solution for deciding whether an array can be split into two non-empty groups with the same average.
806LeetCode 806: Number of Lines To Write StringEasyA simple simulation solution for counting how many 100-pixel lines are needed to write a string.
807LeetCode 807: Max Increase to Keep City SkylineMediumA greedy solution for increasing building heights as much as possible while preserving every skyline view.
808LeetCode 808: Soup ServingsMediumA probability dynamic programming solution for computing whether soup A empties before soup B, with an early return for large input.
809LeetCode 809: Expressive WordsMediumA two-pointer group comparison solution for counting how many words can be stretched to match a target string.
810LeetCode 810: Chalkboard XOR GameHardA math and bit manipulation solution for deciding whether Alice wins the XOR removal game.
811LeetCode 811: Subdomain Visit CountMediumA hash map solution for accumulating visit counts across domains and all of their parent subdomains.
812LeetCode 812: Largest Triangle AreaEasyA geometry solution for finding the largest triangle area by checking every triplet of points with the cross product formula.
813LeetCode 813: Largest Sum of AveragesMediumA dynamic programming and prefix sum solution for partitioning an array into adjacent groups with maximum total average.
814LeetCode 814: Binary Tree PruningMediumA postorder DFS solution for removing every binary tree subtree that does not contain a 1.
815LeetCode 815: Bus RoutesHardA BFS solution for finding the minimum number of buses needed to travel from a source stop to a target stop.
816LeetCode 816: Ambiguous CoordinatesMediumAn enumeration solution for reconstructing all valid coordinate pairs after commas, spaces, and decimal points were removed.
817LeetCode 817: Linked List ComponentsMediumA hash set and linked list traversal solution for counting consecutive components whose values appear in nums.
818LeetCode 818: Race CarHardA dynamic programming solution for finding the shortest instruction sequence that drives a race car to the target position.
819LeetCode 819: Most Common WordEasyA hash map and string parsing solution for finding the most frequent non-banned word in a paragraph.
820LeetCode 820: Short Encoding of WordsMediumA suffix-removal solution for finding the shortest reference string that can encode every word.
821LeetCode 821: Shortest Distance to a CharacterEasyA two-pass solution for computing the shortest distance from each index to the nearest occurrence of a target character.
822LeetCode 822: Card Flipping GameMediumA hash set solution for finding the smallest number that can be hidden from all front-facing cards.
823LeetCode 823: Binary Trees With FactorsMediumA dynamic programming solution for counting binary trees where every non-leaf node is the product of its children.
824LeetCode 824: Goat LatinEasyA string simulation solution for converting each word in a sentence into Goat Latin.
825LeetCode 825: Friends Of Appropriate AgesMediumA counting solution for computing how many directed friend requests are allowed by age rules.
826LeetCode 826: Most Profit Assigning WorkMediumA clear explanation of the Most Profit Assigning Work problem using sorting, greedy choice, and two pointers.
827LeetCode 827: Making A Large IslandHardA clear explanation of the Making A Large Island problem using connected component labeling and island size lookup.
828LeetCode 828: Count Unique Characters of All Substrings of a Given StringHardA clear explanation of Count Unique Characters of All Substrings using contribution counting with previous and next occurrences.
829LeetCode 829: Consecutive Numbers SumHardA clear explanation of the Consecutive Numbers Sum problem using arithmetic series formulas and divisibility analysis.
830LeetCode 830: Positions of Large GroupsEasyA clear explanation of the Positions of Large Groups problem using a simple two-pointer scan.
831LeetCode 831: Masking Personal InformationMediumA clear explanation of the Masking Personal Information problem using string parsing and format-specific masking rules.
832LeetCode 832: Flipping an ImageEasyA clear explanation of the Flipping an Image problem using row reversal, bit inversion, and an in-place two-pointer method.
833LeetCode 833: Find And Replace in StringMediumA clear explanation of the Find And Replace in String problem using simultaneous replacement, source matching, and a replacement map.
834LeetCode 834: Sum of Distances in TreeHardA clear explanation of the Sum of Distances in Tree problem using tree DP, subtree sizes, and rerooting.
835LeetCode 835: Image OverlapMediumA clear explanation of the Image Overlap problem using translation vectors and frequency counting.
836LeetCode 836: Rectangle OverlapEasyA clear explanation of the Rectangle Overlap problem using axis projections and positive intersection area.
837LeetCode 837: New 21 GameMediumA clear explanation of the New 21 Game problem using probability dynamic programming and a sliding window sum.
838LeetCode 838: Push DominoesMediumA clear explanation of the Push Dominoes problem using force propagation and a two-pass scan.
839LeetCode 839: Similar String GroupsHardA clear explanation of the Similar String Groups problem using graph connectivity and union-find.
840LeetCode 840: Magic Squares In GridMediumA clear explanation of the Magic Squares In Grid problem using fixed-size subgrid validation.
841LeetCode 841: Keys and RoomsMediumA clear explanation of the Keys and Rooms problem using graph traversal from room 0.
842LeetCode 842: Split Array into Fibonacci SequenceMediumA clear explanation of the Split Array into Fibonacci Sequence problem using backtracking, leading-zero checks, and 32-bit integer limits.
843LeetCode 843: Guess the WordHardA clear explanation of the Guess the Word interactive problem using candidate filtering and minimax-style guessing.
844LeetCode 844: Backspace String CompareEasyA clear explanation of the Backspace String Compare problem using stack simulation and an O(1) space two-pointer scan.
845LeetCode 845: Longest Mountain in ArrayMediumA clear explanation of the Longest Mountain in Array problem using peak detection and two-pointer expansion.
846LeetCode 846: Hand of StraightsMediumA clear explanation of the Hand of Straights problem using sorting, frequency counting, and greedy grouping.
847LeetCode 847: Shortest Path Visiting All NodesHardA clear explanation of the Shortest Path Visiting All Nodes problem using multi-source BFS and bitmask state compression.
848LeetCode 848: Shifting LettersMediumA clear explanation of the Shifting Letters problem using suffix sums and modulo arithmetic.
849LeetCode 849: Maximize Distance to Closest PersonMediumA clear explanation of the Maximize Distance to Closest Person problem using gaps between occupied seats.
850LeetCode 850: Rectangle Area IIHardA clear explanation of the Rectangle Area II problem using sweep line and merged active y-intervals.
851LeetCode 851: Loud and RichMediumA clear explanation of Loud and Rich using graph traversal, DFS, and memoization.
852LeetCode 852: Peak Index in a Mountain ArrayMediumA clear explanation of finding the peak index in a mountain array using binary search.
853LeetCode 853: Car FleetMediumA clear explanation of counting car fleets by sorting cars by position and tracking arrival times.
854LeetCode 854: K-Similar StringsHardA clear explanation of finding the minimum number of swaps needed to transform one anagram string into another using BFS.
855LeetCode 855: Exam RoomMediumA clear explanation of simulating an exam room by maintaining occupied seats in sorted order.
856LeetCode 856: Score of ParenthesesMediumA clear explanation of scoring a balanced parentheses string using depth counting.
857LeetCode 857: Minimum Cost to Hire K WorkersHardA clear explanation of hiring exactly k workers with minimum total cost using wage-to-quality ratios, sorting, and a max heap.
858LeetCode 858: Mirror ReflectionMediumA clear explanation of Mirror Reflection using room unfolding, least common multiples, and parity.
859LeetCode 859: Buddy StringsEasyA clear explanation of checking whether one swap in a string can make it equal to another string.
860LeetCode 860: Lemonade ChangeEasyA clear explanation of Lemonade Change using greedy simulation and bill counting.
861LeetCode 861: Score After Flipping MatrixMediumA clear explanation of maximizing a binary matrix score using greedy row and column flips.
862LeetCode 862: Shortest Subarray with Sum at Least KHardA clear explanation of finding the shortest non-empty subarray with sum at least k using prefix sums and a monotonic deque.
863LeetCode 863: All Nodes Distance K in Binary TreeMediumA clear explanation of finding all binary tree nodes at distance k from a target node by treating the tree as an undirected graph.
864LeetCode 864: Shortest Path to Get All KeysHardA clear explanation of finding the minimum moves to collect all keys in a grid using BFS with key bitmasks.
865LeetCode 865: Smallest Subtree with all the Deepest NodesMediumA clear explanation of finding the smallest subtree that contains all deepest nodes using bottom-up DFS.
866LeetCode 866: Prime PalindromeMediumA clear explanation of finding the smallest prime palindrome greater than or equal to n by generating odd-length palindromes and testing primality.
867LeetCode 867: Transpose MatrixEasyA clear explanation of transposing a matrix by swapping row and column indices.
868LeetCode 868: Binary GapEasyA clear explanation of finding the maximum distance between adjacent set bits in a binary representation.
869LeetCode 869: Reordered Power of 2MediumA clear explanation of checking whether the digits of a number can be reordered to form a power of two using digit frequency signatures.
870LeetCode 870: Advantage ShuffleMediumA clear explanation of maximizing the advantage of one array over another using sorting, greedy matching, and two pointers.
871LeetCode 871: Minimum Number of Refueling StopsHardA clear explanation of minimizing refueling stops using a greedy max heap over reachable stations.
872LeetCode 872: Leaf-Similar TreesEasyA clear explanation of comparing two binary trees by collecting their leaf value sequences with DFS.
873LeetCode 873: Length of Longest Fibonacci SubsequenceMediumA clear explanation of finding the longest Fibonacci-like subsequence using dynamic programming and value-to-index lookup.
874LeetCode 874: Walking Robot SimulationMediumA clear explanation of simulating robot movement on an infinite grid using direction vectors and obstacle lookup.
875LeetCode 875: Koko Eating BananasMediumA clear explanation of finding the minimum banana-eating speed using binary search on the answer.
876LeetCode 876: Middle of the Linked ListEasyA clear explanation of finding the middle node of a singly linked list using slow and fast pointers.
877LeetCode 877: Stone GameMediumA clear explanation of the Stone Game problem using game theory and interval dynamic programming.
878LeetCode 878: Nth Magical NumberHardA clear explanation of finding the nth magical number using binary search, greatest common divisor, least common multiple, and inclusion-exclusion.
879LeetCode 879: Profitable SchemesHardA clear explanation of counting profitable crime schemes using 0/1 knapsack dynamic programming with members and profit states.
880LeetCode 880: Decoded String at IndexMediumA clear explanation of finding the kth character in a decoded string without building the full decoded string.
881LeetCode 881: Boats to Save PeopleMediumA clear explanation of minimizing rescue boats using sorting, greedy choice, and two pointers.
882LeetCode 882: Reachable Nodes In Subdivided GraphHardA clear explanation of counting reachable original and subdivided nodes using Dijkstra’s shortest path algorithm.
883LeetCode 883: Projection Area of 3D ShapesEasyA clear explanation of computing the projection areas of stacked cubes from top, front, and side views.
884LeetCode 884: Uncommon Words from Two SentencesEasyA clear explanation of finding uncommon words by counting word frequencies across both sentences.
885LeetCode 885: Spiral Matrix IIIMediumA clear explanation of generating grid coordinates in an outward clockwise spiral using simulation.
886LeetCode 886: Possible BipartitionMediumA clear explanation of checking whether people can be split into two groups using graph coloring and bipartite graph detection.
887LeetCode 887: Super Egg DropHardA clear explanation of finding the minimum worst-case number of moves using dynamic programming over eggs and moves.
888LeetCode 888: Fair Candy SwapEasyA clear explanation of finding one candy box swap that makes Alice and Bob have equal total candies.
889LeetCode 889: Construct Binary Tree from Preorder and Postorder TraversalMediumA clear explanation of reconstructing a binary tree from preorder and postorder traversals using recursion and index ranges.
890LeetCode 890: Find and Replace PatternMediumA clear explanation of finding words that match a pattern using bijective character mapping.
891LeetCode 891: Sum of Subsequence WidthsHardA clear explanation of summing subsequence widths by sorting and counting each element as a maximum and minimum.
892LeetCode 892: Surface Area of 3D ShapesEasyA clear explanation of computing the exposed surface area of stacked cubes by adding tower area and subtracting shared faces.
893LeetCode 893: Groups of Special-Equivalent StringsMediumA clear explanation of counting special-equivalent string groups by building canonical signatures from even and odd positions.
894LeetCode 894: All Possible Full Binary TreesMediumA clear explanation of generating all full binary trees with n nodes using recursion and memoization.
895LeetCode 895: Maximum Frequency StackHardA clear explanation of designing a stack that pops the most frequent value, breaking ties by most recent insertion.
896LeetCode 896: Monotonic ArrayEasyA clear explanation of checking whether an array is monotonic using one pass and direction flags.
897LeetCode 897: Increasing Order Search TreeEasyA clear explanation of rearranging a binary search tree into an increasing right-only tree using inorder traversal.
898LeetCode 898: Bitwise ORs of SubarraysMediumA clear explanation of counting distinct bitwise OR results from all non-empty subarrays using rolling sets.
899LeetCode 899: Orderly QueueHardA clear explanation of finding the lexicographically smallest string after queue operations using rotation and sorting.
900LeetCode 900: RLE IteratorMediumA clear explanation of designing an iterator over a run-length encoded sequence without expanding it.
901LeetCode 901: Online Stock SpanMediumA clear explanation of Online Stock Span using a monotonic decreasing stack with accumulated spans.
902LeetCode 902: Numbers At Most N Given Digit SetHardA clear explanation of counting numbers less than or equal to N using digit-by-digit construction and combinatorics.
903LeetCode 903: Valid Permutations for DI SequenceHardA clear explanation of counting valid DI permutations using dynamic programming and prefix sums.
904LeetCode 904: Fruit Into BasketsMediumA clear explanation of Fruit Into Baskets using a sliding window with at most two distinct fruit types.
905LeetCode 905: Sort Array By ParityEasyA clear explanation of sorting an array by parity using a two-pointer partition method.
906LeetCode 906: Super PalindromesHardA clear explanation of counting super-palindromes by generating palindromic roots and checking their squares.
907LeetCode 907: Sum of Subarray MinimumsMediumA clear explanation of summing subarray minimums using a monotonic stack and contribution counting.
908LeetCode 908: Smallest Range IEasyA clear explanation of minimizing an array score after each value can move by at most k.
909LeetCode 909: Snakes and LaddersMediumA clear explanation of Snakes and Ladders using breadth-first search over board squares.
910LeetCode 910: Smallest Range IIMediumA clear explanation of minimizing the array range after adding either +k or -k to every element.
911LeetCode 911: Online ElectionMediumA clear explanation of Online Election using preprocessing and binary search over vote times.
912LeetCode 912: Sort an ArrayMediumA clear explanation of sorting an array without built-in sorting using merge sort.
913LeetCode 913: Cat and MouseHardA clear explanation of Cat and Mouse using game states, reverse BFS, and topological propagation.
914LeetCode 914: X of a Kind in a Deck of CardsEasyA clear explanation of checking whether card counts share a common group size using the greatest common divisor.
915LeetCode 915: Partition Array into Disjoint IntervalsMediumA clear explanation of finding the smallest left partition using prefix maximums and suffix minimums.
916LeetCode 916: Word SubsetsMediumA clear explanation of finding universal words by merging character frequency requirements from words2.
917LeetCode 917: Reverse Only LettersEasyA clear explanation of reversing only English letters while keeping all non-letter characters fixed.
918LeetCode 918: Maximum Sum Circular SubarrayMediumA clear explanation of finding the maximum circular subarray sum using Kadane’s algorithm.
919LeetCode 919: Complete Binary Tree InserterMediumA clear explanation of maintaining a complete binary tree inserter using level-order indexing.
920LeetCode 920: Number of Music PlaylistsHardA clear explanation of counting valid music playlists using dynamic programming over playlist length and unique songs used.
921LeetCode 921: Minimum Add to Make Parentheses ValidMediumA clear explanation of making a parentheses string valid using greedy counting.
922LeetCode 922: Sort Array By Parity IIEasyA clear explanation of placing even numbers at even indices and odd numbers at odd indices using two pointers.
923LeetCode 923: 3Sum With MultiplicityMediumA clear explanation of counting index triplets with duplicate values using frequency counts and combinatorics.
924LeetCode 924: Minimize Malware SpreadHardA clear explanation of minimizing malware spread by analyzing connected components with Union Find.
925LeetCode 925: Long Pressed NameEasyA clear explanation of the Long Pressed Name problem using a two-pointer scan.
926LeetCode 926: Flip String to Monotone IncreasingMediumA clear explanation of solving Flip String to Monotone Increasing with a one-pass dynamic programming approach.
927LeetCode 927: Three Equal PartsHardA clear explanation of solving Three Equal Parts by counting ones, locating the three binary patterns, and comparing them in one pass.
928LeetCode 928: Minimize Malware Spread IIHardA clear explanation of solving Minimize Malware Spread II by removing each infected node and simulating the final malware spread.
929LeetCode 929: Unique Email AddressesEasyA clear explanation of solving Unique Email Addresses using string normalization and a hash set.
930LeetCode 930: Binary Subarrays With SumMediumA clear explanation of solving Binary Subarrays With Sum using prefix sums and a frequency map.
931LeetCode 931: Minimum Falling Path SumMediumA clear explanation of solving Minimum Falling Path Sum using dynamic programming over matrix rows.
932LeetCode 932: Beautiful ArrayMediumA clear explanation of solving Beautiful Array using divide and conquer with odd and even transformations.
933LeetCode 933: Number of Recent CallsEasyA clear explanation of solving Number of Recent Calls using a queue as a sliding time window.
934LeetCode 934: Shortest BridgeMediumA clear explanation of solving Shortest Bridge using DFS to mark one island and BFS to expand toward the other island.
935LeetCode 935: Knight DialerMediumA clear explanation of solving Knight Dialer using dynamic programming over the phone keypad graph.
936LeetCode 936: Stamping The SequenceHardA clear explanation of solving Stamping The Sequence using reverse simulation and BFS-style processing.
937LeetCode 937: Reorder Data in Log FilesEasyA clear explanation of solving Reorder Data in Log Files using custom sorting and stable handling of digit logs.
938LeetCode 938: Range Sum of BSTEasyA clear explanation of solving Range Sum of BST using DFS with binary search tree pruning.
939LeetCode 939: Minimum Area RectangleMediumA clear explanation of solving Minimum Area Rectangle using diagonal point pairs and constant-time point lookup.
940LeetCode 940: Distinct Subsequences IIHardA clear explanation of solving Distinct Subsequences II using dynamic programming and last occurrence tracking.
941LeetCode 941: Valid Mountain ArrayEasyA clear explanation of solving Valid Mountain Array by walking up the increasing slope and then down the decreasing slope.
942LeetCode 942: DI String MatchEasyA clear explanation of solving DI String Match using a greedy two-pointer construction.
943LeetCode 943: Find the Shortest SuperstringHardA clear explanation of solving Find the Shortest Superstring using pairwise overlaps and bitmask dynamic programming.
944LeetCode 944: Delete Columns to Make SortedEasyA clear explanation of solving Delete Columns to Make Sorted by checking each column independently.
945LeetCode 945: Minimum Increment to Make Array UniqueMediumA clear explanation of solving Minimum Increment to Make Array Unique by sorting and greedily assigning the next available value.
946LeetCode 946: Validate Stack SequencesMediumA clear explanation of solving Validate Stack Sequences by simulating stack push and pop operations.
947LeetCode 947: Most Stones Removed with Same Row or ColumnMediumA clear explanation of solving Most Stones Removed with Same Row or Column using connected components and union-find.
948LeetCode 948: Bag of TokensMediumA clear explanation of solving Bag of Tokens using sorting, greedy choices, and two pointers.
949LeetCode 949: Largest Time for Given DigitsMediumA clear explanation of solving Largest Time for Given Digits by checking all permutations of four digits.
950LeetCode 950: Reveal Cards In Increasing OrderMediumA clear explanation of solving Reveal Cards In Increasing Order using sorting and queue simulation over indices.
951LeetCode 951: Flip Equivalent Binary TreesMediumA clear explanation of checking whether two binary trees are equivalent after swapping left and right children at any number of nodes.
952LeetCode 952: Largest Component Size by Common FactorHardA clear explanation of solving Largest Component Size by Common Factor using prime factorization and union find.
953LeetCode 953: Verifying an Alien DictionaryEasyA clear explanation of checking whether words are sorted according to a custom alien alphabet order.
954LeetCode 954: Array of Doubled PairsMediumA clear explanation of checking whether an array can be reordered into pairs where one number is double the other.
955LeetCode 955: Delete Columns to Make Sorted IIMediumA clear explanation of deleting the minimum number of columns so rows become lexicographically sorted.
956LeetCode 956: Tallest BillboardHardA clear explanation of solving Tallest Billboard using dynamic programming over height differences.
957LeetCode 957: Prison Cells After N DaysMediumA clear explanation of simulating prison cell transitions efficiently using cycle detection.
958LeetCode 958: Check Completeness of a Binary TreeMediumA clear explanation of checking whether a binary tree is complete using level-order traversal.
959LeetCode 959: Regions Cut By SlashesMediumA clear explanation of counting regions formed by slashes using union find over four triangles per cell.
960LeetCode 960: Delete Columns to Make Sorted IIIHardA clear explanation of deleting the minimum number of columns so every remaining row is individually sorted.
961LeetCode 961: N-Repeated Element in Size 2N ArrayEasyA clear explanation of finding the element repeated N times using a hash set.
962LeetCode 962: Maximum Width RampMediumA clear explanation of finding the maximum width ramp using a monotonic decreasing stack.
963LeetCode 963: Minimum Area Rectangle IIMediumA clear explanation of finding the minimum-area rectangle from points when the rectangle may be rotated.
964LeetCode 964: Least Operators to Express NumberHardA clear explanation of expressing a target using the fewest operators with repeated uses of x.
965LeetCode 965: Univalued Binary TreeEasyA clear explanation of checking whether every node in a binary tree has the same value.
966LeetCode 966: Vowel SpellcheckerMediumA clear explanation of implementing a spellchecker with exact, case-insensitive, and vowel-error matching.
967LeetCode 967: Numbers With Same Consecutive DifferencesMediumA clear explanation of generating all n-digit numbers whose adjacent digits differ by k.
968LeetCode 968: Binary Tree CamerasHardA clear explanation of placing the minimum number of cameras in a binary tree using postorder DFS.
969LeetCode 969: Pancake SortingMediumA clear explanation of sorting an array using prefix reversals by repeatedly placing the largest remaining value.
970LeetCode 970: Powerful IntegersMediumA clear explanation of generating all powerful integers using bounded powers and a set.
971LeetCode 971: Flip Binary Tree To Match Preorder TraversalMediumA clear explanation of matching a binary tree preorder traversal by greedily flipping nodes.
972LeetCode 972: Equal Rational NumbersHardA clear explanation of comparing rational numbers written as decimal strings with optional repeating parts.
973LeetCode 973: K Closest Points to OriginMediumA clear explanation of returning the k closest points to the origin using squared distance and sorting.
974LeetCode 974: Subarray Sums Divisible by KMediumA clear explanation of counting subarrays whose sum is divisible by k using prefix sums and remainder frequencies.
975LeetCode 975: Odd Even JumpHardA clear explanation of counting good starting indices using next-jump preprocessing and dynamic programming.
976LeetCode 976: Largest Perimeter TriangleEasyA clear explanation of finding the largest valid triangle perimeter using sorting and a greedy scan.
977LeetCode 977: Squares of a Sorted ArrayEasyA clear explanation of sorting squared values from a sorted array using two pointers.
978LeetCode 978: Longest Turbulent SubarrayMediumA clear explanation of finding the longest subarray whose adjacent comparisons alternate between greater-than and less-than.
979LeetCode 979: Distribute Coins in Binary TreeMediumA clear explanation of balancing coins in a binary tree using postorder DFS and subtree coin balance.
980LeetCode 980: Unique Paths IIIHardA clear explanation of counting all paths from start to end that visit every non-obstacle square exactly once using backtracking.
981LeetCode 981: Time Based Key-Value StoreMediumA clear explanation of designing a time-based key-value store using a hash map and binary search.
982LeetCode 982: Triples with Bitwise AND Equal To ZeroHardA clear explanation of counting ordered triples whose bitwise AND is zero using pairwise AND counts.
983LeetCode 983: Minimum Cost For TicketsMediumA clear explanation of finding the cheapest way to cover all travel days using dynamic programming.
984LeetCode 984: String Without AAA or BBBMediumA clear explanation of constructing a string with exact counts of a and b while avoiding three equal consecutive characters.
985LeetCode 985: Sum of Even Numbers After QueriesMediumA clear explanation of maintaining the sum of even numbers after each array update.
986LeetCode 986: Interval List IntersectionsMediumA clear explanation of finding intersections between two sorted disjoint interval lists using two pointers.
987LeetCode 987: Vertical Order Traversal of a Binary TreeHardA clear explanation of vertical tree traversal using coordinates, DFS, sorting, and column grouping.
988LeetCode 988: Smallest String Starting From LeafMediumA clear explanation of finding the lexicographically smallest leaf-to-root string in a binary tree using DFS.
989LeetCode 989: Add to Array-Form of IntegerEasyA clear explanation of adding an integer to an array-form number using digit-by-digit simulation.
990LeetCode 990: Satisfiability of Equality EquationsMediumA clear explanation of checking equality and inequality constraints using union-find.
991LeetCode 991: Broken CalculatorMediumA clear explanation of finding the minimum operations by working backward from target to startValue.
992LeetCode 992: Subarrays with K Different IntegersHardA clear explanation of counting subarrays with exactly k distinct integers using the at-most-k sliding window trick.
993LeetCode 993: Cousins in Binary TreeEasyA clear explanation of checking whether two binary tree nodes are cousins using BFS with parent tracking.
994LeetCode 994: Rotting OrangesMediumA clear explanation of finding the minimum time for all oranges to rot using multi-source BFS.
995LeetCode 995: Minimum Number of K Consecutive Bit FlipsHardA clear explanation of making all bits equal to 1 using greedy left-to-right flips and a sliding window flip parity.
996LeetCode 996: Number of Squareful ArraysHardA clear explanation of counting unique permutations where every adjacent pair sums to a perfect square using backtracking.
997LeetCode 997: Find the Town JudgeEasyA clear explanation of identifying the town judge using trust indegree and outdegree counts.
998LeetCode 998: Maximum Binary Tree IIMediumA clear explanation of inserting a value into a maximum binary tree by following the right spine.
999LeetCode 999: Available Captures for RookEasyA clear explanation of counting how many pawns a rook can capture by scanning four directions on a chessboard.
1000LeetCode 1000: Minimum Cost to Merge StonesHardA clear explanation of merging consecutive stone piles with minimum cost using interval dynamic programming.
LeetCode 01xxLeetCode practice notes for problems 100 through 199, including A detailed guide to solving Same Tree with recursive DFS and structural comparison.
100 pages · 514 min
LeetCode 02xxLeetCode practice notes for problems 200 through 299, including A clear explanation of counting connected groups of land cells in a grid using DFS or BFS.
100 pages · 532 min
LeetCode 03xxLeetCode practice notes for problems 300 through 399, including A dynamic programming and patience sorting solution for finding the longest strictly increasing subsequence in an array.
100 pages · 537 min
LeetCode 04xxLeetCode practice notes for problems 400 through 499, including A clear explanation of finding the nth digit in the infinite integer sequence using digit groups and arithmetic.
100 pages · 552 min
LeetCode 05xxLeetCode practice notes for problems 500 through 599, including A clear explanation of filtering words that can be typed using only one row of an American keyboard.
100 pages · 497 min
LeetCode 06xxLeetCode practice notes for problems 600 through 699, including A clear digit dynamic programming solution for counting numbers whose binary representation does not contain consecutive ones.
100 pages · 538 min
LeetCode 07xxLeetCode practice notes for problems 700 through 799, including Search for a target value in a binary search tree and return the subtree rooted at the matching node.
100 pages · 552 min
LeetCode 08xxLeetCode practice notes for problems 800 through 899, including A clear explanation of finding the closest shorthand RGB color by rounding each color channel to the nearest repeated hexadecimal pair.
100 pages · 535 min
LeetCode 09xxLeetCode practice notes for problems 900 through 999, including A clear explanation of designing an iterator over a run-length encoded sequence without expanding it.
100 pages · 531 min
LeetCode 10xxLeetCode practice notes for problems 1000 through 1000, including A clear explanation of merging consecutive stone piles with minimum cost using interval dynamic programming.
1 pages · 6 min
LeetCode 00xxLeetCode practice notes for problems 1 through 99, including A clear explanation of the Two Sum problem using brute force first, then an optimized hash map solution.
99 pages · 538 min