Skip to content

LeetCode 10xx

LeetCode practice notes for problems 1000 through 1100, covering interval DP, sliding window, binary search, greedy, SQL, and more.

#TitleDifficultyDescription
1000LeetCode 1000: Minimum Cost to Merge StonesHardA clear explanation of merging consecutive stone piles with minimum cost using interval dynamic programming.
1001LeetCode 1001: Grid IlluminationHardA clear explanation of simulating lamp illumination on a grid using hash maps for rows, columns, and diagonals.
1002LeetCode 1002: Find Common CharactersEasyA clear explanation of finding characters that appear in all words using minimum frequency counts.
1003LeetCode 1003: Check If Word Is Valid After SubstitutionsMediumA clear explanation of validating a string by repeatedly removing ‘abc’ substrings using a stack.
1004LeetCode 1004: Max Consecutive Ones IIIMediumA clear explanation of finding the longest subarray of ones by flipping at most k zeros using a sliding window.
1005LeetCode 1005: Maximize Sum Of Array After K NegationsEasyA clear explanation of maximizing array sum after exactly k negations using a greedy strategy.
1006LeetCode 1006: Clumsy FactorialMediumA clear explanation of computing the clumsy factorial by simulating cyclic operators with a stack.
1007LeetCode 1007: Minimum Domino Rotations For Equal RowMediumA clear explanation of finding minimum rotations to make all tops or bottoms equal using a greedy candidate check.
1008LeetCode 1008: Construct Binary Search Tree from Preorder TraversalMediumA clear explanation of reconstructing a BST from its preorder traversal using value range bounds.
1009LeetCode 1009: Complement of Base 10 IntegerEasyA clear explanation of finding the complement of a number by XORing with a bitmask of the same bit length.
1010LeetCode 1010: Pairs of Songs With Total Durations Divisible by 60MediumA clear explanation of counting song pairs whose total duration is divisible by 60 using remainder frequency counting.
1011LeetCode 1011: Capacity To Ship Packages Within D DaysMediumA clear explanation of finding the minimum ship capacity to deliver all packages within D days using binary search.
1012LeetCode 1012: Numbers With Repeated DigitsHardA clear explanation of counting numbers up to n with at least one repeated digit using digit DP and combinatorics.
1013LeetCode 1013: Partition Array Into Three Parts With Equal SumEasyA clear explanation of checking if an array can be split into three contiguous parts with equal sum using a greedy two-pass approach.
1014LeetCode 1014: Best Sightseeing PairMediumA clear explanation of maximizing the sightseeing score by tracking the best left value seen so far in a single pass.
1015LeetCode 1015: Smallest Integer Divisible by KMediumA clear explanation of finding the smallest repunit divisible by K by tracking remainders to detect cycles.
1016LeetCode 1016: Binary String With Substrings Representing 1 To NMediumA clear explanation of checking whether a binary string contains all binary representations of integers from 1 to n.
1017LeetCode 1017: Convert to Base -2MediumA clear explanation of converting a non-negative integer to its base negative-two representation.
1018LeetCode 1018: Binary Prefix Divisible By 5EasyA clear explanation of checking divisibility of binary prefixes by 5 using running remainder tracking.
1019LeetCode 1019: Next Greater Node In Linked ListMediumA clear explanation of finding the next greater value for each node in a linked list using a monotonic stack.
1020LeetCode 1020: Number of EnclavesMediumA clear explanation of counting land cells unreachable from the grid border using BFS from boundary land cells.
1021LeetCode 1021: Remove Outermost ParenthesesEasyA clear explanation of removing outermost parentheses from each primitive decomposition by tracking nesting depth.
1022LeetCode 1022: Sum of Root To Leaf Binary NumbersEasyA clear explanation of summing root-to-leaf binary numbers in a binary tree using DFS with accumulated values.
1023LeetCode 1023: Camelcase MatchingMediumA clear explanation of checking camelCase pattern matching by verifying uppercase consistency with a two-pointer approach.
1024LeetCode 1024: Video StitchingMediumA clear explanation of finding the minimum number of video clips to cover a time range using a greedy interval covering approach.
1025LeetCode 1025: Divisor GameEasyA clear explanation of why Alice wins the divisor game if and only if n is even, proven by mathematical induction.
1026LeetCode 1026: Maximum Difference Between Node and AncestorMediumA clear explanation of finding the maximum ancestor-node difference in a binary tree by tracking min and max along each root-to-leaf path.
1027LeetCode 1027: Longest Arithmetic SubsequenceMediumA clear explanation of finding the longest arithmetic subsequence in an array using dynamic programming with difference hash maps.
1028LeetCode 1028: Recover a Tree From Preorder TraversalHardA clear explanation of reconstructing a binary tree from a depth-encoded preorder traversal string using a stack.
1029LeetCode 1029: Two City SchedulingMediumA clear explanation of minimizing total travel cost for two-city scheduling using a greedy refund approach after sending everyone to city A.
1030LeetCode 1030: Matrix Cells in Distance OrderEasyA clear explanation of sorting matrix cells by Chebyshev distance from a given center cell using BFS.
1031LeetCode 1031: Maximum Sum of Two Non-Overlapping SubarraysMediumA clear explanation of finding two non-overlapping subarrays with maximum combined sum using prefix sums and running maximums.
1032LeetCode 1032: Stream of CharactersHardA clear explanation of efficiently querying a stream of characters against a word list using an Aho-Corasick trie.
1033LeetCode 1033: Moving Stones Until ConsecutiveEasyA clear explanation of finding the minimum and maximum moves to make three stones consecutive by analyzing gap cases.
1034LeetCode 1034: Coloring A BorderMediumA clear explanation of coloring the border of a connected component in a grid using BFS.
1035LeetCode 1035: Uncrossed LinesMediumA clear explanation of maximizing uncrossed connecting lines between two arrays using longest common subsequence dynamic programming.
1036LeetCode 1036: Escape a Large MazeHardA clear explanation of determining if a source can reach a target in a very large grid with blocked cells using BFS with a cell count limit.
1037LeetCode 1037: Valid BoomerangEasyA clear explanation of checking if three points form a boomerang (non-collinear) using the cross product.
1038LeetCode 1038: Binary Search Tree to Greater Sum TreeMediumA clear explanation of converting a BST to a greater sum tree by accumulating values in reverse inorder traversal.
1039LeetCode 1039: Minimum Score Triangulation of PolygonMediumA clear explanation of minimizing the total score of triangulating a polygon using interval dynamic programming.
1040LeetCode 1040: Moving Stones Until Consecutive IIMediumA clear explanation of finding minimum and maximum moves to make stones consecutive using a sliding window.
1041LeetCode 1041: Robot Bounded In CircleMediumA clear explanation of determining if a robot stays in a bounded circle by checking position and direction after one instruction cycle.
1042LeetCode 1042: Flower Planting With No AdjacentMediumA clear explanation of assigning 4 flower types to garden nodes with no adjacent conflicts using greedy graph coloring.
1043LeetCode 1043: Partition Array for Maximum SumMediumA clear explanation of maximizing array sum by partitioning into subarrays of at most k elements, each filled with their maximum value, using dynamic programming.
1044LeetCode 1044: Longest Duplicate SubstringHardA clear explanation of finding the longest duplicate substring using binary search on length combined with Rabin-Karp rolling hash.
1045LeetCode 1045: Customers Who Bought All ProductsMediumA clear explanation of finding customers who purchased every product in the catalog using GROUP BY and HAVING with COUNT DISTINCT.
1046LeetCode 1046: Last Stone WeightEasyA clear explanation of simulating stone smashing to find the last remaining weight using a max heap.
1047LeetCode 1047: Remove All Adjacent Duplicates In StringEasyA clear explanation of eliminating adjacent duplicate character pairs from a string using a stack.
1048LeetCode 1048: Longest String ChainMediumA clear explanation of finding the longest word chain where each word is formed by inserting one letter into the previous word, using dynamic programming.
1049LeetCode 1049: Last Stone Weight IIMediumA clear explanation of minimizing the last stone weight by splitting stones into two groups using 0/1 knapsack dynamic programming.
1050LeetCode 1050: Actors and Directors Who Cooperated At Least Three TimesEasyA clear explanation of finding actor-director pairs with at least three collaborations using GROUP BY and HAVING.
1051LeetCode 1051: Height CheckerEasyA clear explanation of counting students not in the expected height order by comparing the array to its sorted version.
1052LeetCode 1052: Grumpy Bookstore OwnerMediumA clear explanation of maximizing satisfied customers by choosing the best window for the owner to not be grumpy using a sliding window.
1053LeetCode 1053: Previous Permutation With One SwapMediumA clear explanation of finding the lexicographically largest permutation smaller than the given array using at most one swap.
1054LeetCode 1054: Distant BarcodesMediumA clear explanation of rearranging barcodes so no two adjacent barcodes are equal using a greedy max-heap approach.
1055LeetCode 1055: Shortest Way to Form StringMediumA clear explanation of finding the minimum number of subsequences of source needed to form target using greedy two-pointer scanning.
1056LeetCode 1056: Confusing NumberEasyA clear explanation of checking if a number becomes a different valid number when rotated 180 degrees.
1057LeetCode 1057: Campus BikesMediumA clear explanation of greedily assigning bikes to workers based on Manhattan distance, prioritizing by distance then worker then bike index.
1058LeetCode 1058: Minimize Rounding Error to Meet TargetMediumA clear explanation of minimizing total rounding error when rounding prices to meet a target sum using a greedy approach.
1059LeetCode 1059: All Paths from Source Lead to DestinationMediumA clear explanation of verifying that all paths from a source node lead to a destination using DFS with cycle detection.
1060LeetCode 1060: Missing Element in Sorted ArrayMediumA clear explanation of finding the k-th missing number in a sorted array using binary search on the missing count.
1061LeetCode 1061: Lexicographically Smallest Equivalent StringMediumA clear explanation of finding the lexicographically smallest equivalent string using Union-Find with canonical representatives.
1062LeetCode 1062: Longest Repeating SubstringMediumA clear explanation of finding the longest substring that appears at least twice using binary search on length with rolling hash.
1063LeetCode 1063: Number of Valid SubarraysHardA clear explanation of counting subarrays where the leftmost element is not larger than any other element, using a monotonic stack.
1064LeetCode 1064: Fixed PointEasyA clear explanation of finding the smallest index where arr[i] equals i using binary search on a sorted distinct array.
1065LeetCode 1065: Index Pairs of a StringEasyA clear explanation of finding all index pairs where a word from the list appears in a text string using a trie.
1066LeetCode 1066: Campus Bikes IIMediumA clear explanation of finding the minimum total Manhattan distance to assign bikes to workers using bitmask dynamic programming.
1067LeetCode 1067: Digit Count in RangeHardA clear explanation of counting the occurrences of a specific digit in all numbers from 1 to n using digit dynamic programming.
1068LeetCode 1068: Product Sales Analysis IEasyA clear explanation of retrieving product names and their sale years using a JOIN between Sales and Product tables.
1069LeetCode 1069: Product Sales Analysis IIEasyA clear explanation of computing total quantity sold per product using GROUP BY and SUM aggregation.
1070LeetCode 1070: Product Sales Analysis IIIMediumA clear explanation of finding the first year each product was sold using a self-join or window function.
1071LeetCode 1071: Greatest Common Divisor of StringsEasyA clear explanation of finding the longest string that divides both strings using the GCD of their lengths.
1072LeetCode 1072: Flip Columns For Maximum Number of Equal RowsMediumA clear explanation of finding the maximum number of rows that can be made all-equal by flipping columns, using row pattern normalization.
1073LeetCode 1073: Adding Negative NumbersEasyA clear explanation of adding two non-positive integers represented as arrays of digits.
1074LeetCode 1074: Number of Submatrices That Sum to TargetHardA clear explanation of counting submatrices with a given sum using 2D prefix sums combined with the subarray sum equals k technique.
1075LeetCode 1075: Project Employees IEasyA clear explanation of computing the average years of experience per project using JOIN and AVG aggregation.
1076LeetCode 1076: Project Employees IIEasyA clear explanation of finding the project with the most employees using GROUP BY, COUNT, and a subquery for the maximum.
1077LeetCode 1077: Project Employees IIIMediumA clear explanation of finding the most experienced employee(s) for each project using a window function or correlated subquery.
1078LeetCode 1078: Occurrences After BigramEasyA clear explanation of finding all words that follow a two-word sequence in a text string.
1079LeetCode 1079: Letter Tile PossibilitiesMediumA clear explanation of counting all distinct non-empty sequences from a set of letter tiles using backtracking with frequency counting.
1080LeetCode 1080: Insufficient Nodes in Root to Leaf PathsMediumA clear explanation of pruning tree nodes where all root-to-leaf paths through them have sum less than a limit, using post-order DFS.
1081LeetCode 1081: Smallest Subsequence of Distinct CharactersMediumA clear explanation of finding the lexicographically smallest subsequence with all distinct characters using a greedy stack approach.
1082LeetCode 1082: Sales Analysis IEasyA clear explanation of finding the best seller(s) by total price using GROUP BY, SUM, and a subquery for the maximum.
1083LeetCode 1083: Sales Analysis IIEasyA clear explanation of finding buyers who bought an iPhone but not an iPad using JOIN and NOT IN filtering.
1084LeetCode 1084: Sales Analysis IIIEasyA clear explanation of finding products sold only in the first quarter of 2019 using GROUP BY with date range conditions.
1085LeetCode 1085: Sum of Digits in the Minimum NumberEasyA clear explanation of checking if the digit sum of the array minimum is odd or even.
1086LeetCode 1086: High FiveEasyA clear explanation of computing each student’s top-5 average score using sorting and grouping.
1087LeetCode 1087: Brace ExpansionMediumA clear explanation of generating all strings from a brace expansion pattern in lexicographic order using backtracking.
1088LeetCode 1088: Confusing Number IIHardA clear explanation of counting confusing numbers up to n using digit backtracking with rotation validation.
1089LeetCode 1089: Duplicate ZerosEasyA clear explanation of duplicating zeros in-place in an array without using extra space by working backwards.
1090LeetCode 1090: Largest Values From LabelsMediumA clear explanation of selecting the maximum sum subset under item and label count constraints using a greedy approach.
1091LeetCode 1091: Shortest Path in Binary MatrixMediumA clear explanation of finding the shortest path from top-left to bottom-right in a binary matrix using BFS.
1092LeetCode 1092: Shortest Common SupersequenceHardA clear explanation of finding the shortest string containing both input strings as subsequences using LCS dynamic programming.
1093LeetCode 1093: Statistics from a Large SampleMediumA clear explanation of computing statistical measures (minimum, maximum, mean, median, mode) from a frequency count array.
1094LeetCode 1094: Car PoolingMediumA clear explanation of determining if a car can transport all passengers using a difference array for passenger count tracking.
1095LeetCode 1095: Find in Mountain ArrayHardA clear explanation of finding a target in a mountain array using three binary searches on the interface API.
1096LeetCode 1096: Brace Expansion IIHardA clear explanation of generating all strings from a brace expansion expression using recursive parsing and set union/concatenation.
1097LeetCode 1097: Game Play Analysis VHardA clear explanation of finding the fraction of players retained the day after their first login using self-join and window functions.
1098LeetCode 1098: Unpopular BooksMediumA clear explanation of finding books with fewer than 10 sales in the last year that were not sold in the last year using LEFT JOIN and GROUP BY.
1099LeetCode 1099: Two Sum Less Than KEasyA clear explanation of finding the maximum sum of two numbers less than k using a two-pointer approach on a sorted array.
1100LeetCode 1100: Find K-Length Substrings With No Repeated CharactersMediumA clear explanation of counting substrings of length k with all unique characters using a sliding window.
LeetCode 1000: Minimum Cost to Merge StonesA clear explanation of merging consecutive stone piles with minimum cost using interval dynamic programming.
6 min
LeetCode 1001: Grid IlluminationA clear explanation of simulating lamp illumination on a grid using hash maps for rows, columns, and diagonals.
5 min
LeetCode 1002: Find Common CharactersA clear explanation of finding characters that appear in all words using minimum frequency counts.
3 min
LeetCode 1003: Check If Word Is Valid After SubstitutionsA clear explanation of validating a string by repeatedly removing 'abc' substrings using a stack.
3 min
LeetCode 1004: Max Consecutive Ones IIIA clear explanation of finding the longest subarray of ones by flipping at most k zeros using a sliding window.
4 min
LeetCode 1005: Maximize Sum Of Array After K NegationsA clear explanation of maximizing array sum after exactly k negations using a greedy strategy.
4 min
LeetCode 1006: Clumsy FactorialA clear explanation of computing the clumsy factorial by simulating cyclic operators with a stack.
4 min
LeetCode 1007: Minimum Domino Rotations For Equal RowA clear explanation of finding minimum rotations to make all tops or bottoms equal using a greedy candidate check.
4 min
LeetCode 1008: Construct Binary Search Tree from Preorder TraversalA clear explanation of reconstructing a BST from its preorder traversal using value range bounds.
4 min
LeetCode 1009: Complement of Base 10 IntegerA clear explanation of finding the complement of a number by XORing with a bitmask of the same bit length.
3 min
LeetCode 1010: Pairs of Songs With Total Durations Divisible by 60A clear explanation of counting song pairs whose total duration is divisible by 60 using remainder frequency counting.
3 min
LeetCode 1011: Capacity To Ship Packages Within D DaysA clear explanation of finding the minimum ship capacity to deliver all packages within D days using binary search.
4 min
LeetCode 1012: Numbers With Repeated DigitsA clear explanation of counting numbers up to n with at least one repeated digit using digit DP and combinatorics.
4 min
LeetCode 1013: Partition Array Into Three Parts With Equal SumA clear explanation of checking if an array can be split into three contiguous parts with equal sum using a greedy two-pass approach.
4 min
LeetCode 1014: Best Sightseeing PairA clear explanation of maximizing the sightseeing score by tracking the best left value seen so far in a single pass.
3 min
LeetCode 1015: Smallest Integer Divisible by KA clear explanation of finding the smallest repunit divisible by K by tracking remainders to detect cycles.
3 min
LeetCode 1016: Binary String With Substrings Representing 1 To NA clear explanation of checking whether a binary string contains all binary representations of integers from 1 to n.
3 min
LeetCode 1017: Convert to Base -2A clear explanation of converting a non-negative integer to its base negative-two representation.
3 min
LeetCode 1018: Binary Prefix Divisible By 5A clear explanation of checking divisibility of binary prefixes by 5 using running remainder tracking.
3 min
LeetCode 1019: Next Greater Node In Linked ListA clear explanation of finding the next greater value for each node in a linked list using a monotonic stack.
4 min
LeetCode 1020: Number of EnclavesA clear explanation of counting land cells unreachable from the grid border using BFS from boundary land cells.
4 min
LeetCode 1021: Remove Outermost ParenthesesA clear explanation of removing outermost parentheses from each primitive decomposition by tracking nesting depth.
3 min
LeetCode 1022: Sum of Root To Leaf Binary NumbersA clear explanation of summing root-to-leaf binary numbers in a binary tree using DFS with accumulated values.
3 min
LeetCode 1023: Camelcase MatchingA clear explanation of checking camelCase pattern matching by verifying uppercase consistency with a two-pointer approach.
4 min
LeetCode 1024: Video StitchingA clear explanation of finding the minimum number of video clips to cover a time range using a greedy interval covering approach.
3 min
LeetCode 1025: Divisor GameA clear explanation of why Alice wins the divisor game if and only if n is even, proven by mathematical induction.
3 min
LeetCode 1026: Maximum Difference Between Node and AncestorA clear explanation of finding the maximum ancestor-node difference in a binary tree by tracking min and max along each root-to-leaf path.
3 min
LeetCode 1027: Longest Arithmetic SubsequenceA clear explanation of finding the longest arithmetic subsequence in an array using dynamic programming with difference hash maps.
3 min
LeetCode 1028: Recover a Tree From Preorder TraversalA clear explanation of reconstructing a binary tree from a depth-encoded preorder traversal string using a stack.
4 min
LeetCode 1029: Two City SchedulingA clear explanation of minimizing total travel cost for two-city scheduling using a greedy refund approach after sending everyone to city A.
3 min
LeetCode 1030: Matrix Cells in Distance OrderA clear explanation of sorting matrix cells by Chebyshev distance from a given center cell using BFS.
3 min
LeetCode 1031: Maximum Sum of Two Non-Overlapping SubarraysA clear explanation of finding two non-overlapping subarrays with maximum combined sum using prefix sums and running maximums.
3 min
LeetCode 1032: Stream of CharactersA clear explanation of efficiently querying a stream of characters against a word list using an Aho-Corasick trie.
3 min
LeetCode 1033: Moving Stones Until ConsecutiveA clear explanation of finding the minimum and maximum moves to make three stones consecutive by analyzing gap cases.
3 min
LeetCode 1034: Coloring A BorderA clear explanation of coloring the border of a connected component in a grid using BFS.
3 min
LeetCode 1035: Uncrossed LinesA clear explanation of maximizing uncrossed connecting lines between two arrays using longest common subsequence dynamic programming.
3 min
LeetCode 1036: Escape a Large MazeA clear explanation of determining if a source can reach a target in a very large grid with blocked cells using BFS with a cell count limit.
3 min
LeetCode 1037: Valid BoomerangA clear explanation of checking if three points form a boomerang (non-collinear) using the cross product.
2 min
LeetCode 1038: Binary Search Tree to Greater Sum TreeA clear explanation of converting a BST to a greater sum tree by accumulating values in reverse inorder traversal.
3 min
LeetCode 1039: Minimum Score Triangulation of PolygonA clear explanation of minimizing the total score of triangulating a polygon using interval dynamic programming.
3 min
LeetCode 1040: Moving Stones Until Consecutive IIA clear explanation of finding minimum and maximum moves to make stones consecutive using a sliding window.
3 min
LeetCode 1041: Robot Bounded In CircleA clear explanation of determining if a robot stays in a bounded circle by checking position and direction after one instruction cycle.
3 min
LeetCode 1042: Flower Planting With No AdjacentA clear explanation of assigning 4 flower types to garden nodes with no adjacent conflicts using greedy graph coloring.
3 min
LeetCode 1043: Partition Array for Maximum SumA clear explanation of maximizing array sum by partitioning into subarrays of at most k elements, each filled with their maximum value, using dynamic programming.
3 min
LeetCode 1044: Longest Duplicate SubstringA clear explanation of finding the longest duplicate substring using binary search on length combined with Rabin-Karp rolling hash.
3 min
LeetCode 1045: Customers Who Bought All ProductsA clear explanation of finding customers who purchased every product in the catalog using GROUP BY and HAVING with COUNT DISTINCT.
2 min
LeetCode 1046: Last Stone WeightA clear explanation of simulating stone smashing to find the last remaining weight using a max heap.
2 min
LeetCode 1047: Remove All Adjacent Duplicates In StringA clear explanation of eliminating adjacent duplicate character pairs from a string using a stack.
2 min
LeetCode 1048: Longest String ChainA clear explanation of finding the longest word chain where each word is formed by inserting one letter into the previous word, using dynamic programming.
3 min
LeetCode 1049: Last Stone Weight IIA clear explanation of minimizing the last stone weight by splitting stones into two groups using 0/1 knapsack dynamic programming.
3 min
LeetCode 1050: Actors and Directors Who Cooperated At Least Three TimesA clear explanation of finding actor-director pairs with at least three collaborations using GROUP BY and HAVING.
2 min
LeetCode 1051: Height CheckerA clear explanation of counting students not in the expected height order by comparing the array to its sorted version.
2 min
LeetCode 1052: Grumpy Bookstore OwnerA clear explanation of maximizing satisfied customers by choosing the best window for the owner to not be grumpy using a sliding window.
3 min
LeetCode 1053: Previous Permutation With One SwapA clear explanation of finding the lexicographically largest permutation smaller than the given array using at most one swap.
3 min
LeetCode 1054: Distant BarcodesA clear explanation of rearranging barcodes so no two adjacent barcodes are equal using a greedy max-heap approach.
2 min
LeetCode 1055: Shortest Way to Form StringA clear explanation of finding the minimum number of subsequences of source needed to form target using greedy two-pointer scanning.
2 min
LeetCode 1056: Confusing NumberA clear explanation of checking if a number becomes a different valid number when rotated 180 degrees.
2 min
LeetCode 1057: Campus BikesA clear explanation of greedily assigning bikes to workers based on Manhattan distance, prioritizing by distance then worker then bike index.
2 min
LeetCode 1058: Minimize Rounding Error to Meet TargetA clear explanation of minimizing total rounding error when rounding prices to meet a target sum using a greedy approach.
3 min
LeetCode 1059: All Paths from Source Lead to DestinationA clear explanation of verifying that all paths from a source node lead to a destination using DFS with cycle detection.
2 min
LeetCode 1060: Missing Element in Sorted ArrayA clear explanation of finding the k-th missing number in a sorted array using binary search on the missing count.
2 min
LeetCode 1061: Lexicographically Smallest Equivalent StringA clear explanation of finding the lexicographically smallest equivalent string using Union-Find with canonical representatives.
3 min
LeetCode 1062: Longest Repeating SubstringA clear explanation of finding the longest substring that appears at least twice using binary search on length with rolling hash.
2 min
LeetCode 1063: Number of Valid SubarraysA clear explanation of counting subarrays where the leftmost element is not larger than any other element, using a monotonic stack.
3 min
LeetCode 1064: Fixed PointA clear explanation of finding the smallest index where arr[i] equals i using binary search on a sorted distinct array.
2 min
LeetCode 1065: Index Pairs of a StringA clear explanation of finding all index pairs where a word from the list appears in a text string using a trie.
2 min
LeetCode 1066: Campus Bikes IIA clear explanation of finding the minimum total Manhattan distance to assign bikes to workers using bitmask dynamic programming.
2 min
LeetCode 1067: Digit Count in RangeA clear explanation of counting the occurrences of a specific digit in all numbers from 1 to n using digit dynamic programming.
3 min
LeetCode 1068: Product Sales Analysis IA clear explanation of retrieving product names and their sale years using a JOIN between Sales and Product tables.
2 min
LeetCode 1069: Product Sales Analysis IIA clear explanation of computing total quantity sold per product using GROUP BY and SUM aggregation.
1 min
LeetCode 1070: Product Sales Analysis IIIA clear explanation of finding the first year each product was sold using a self-join or window function.
2 min
LeetCode 1071: Greatest Common Divisor of StringsA clear explanation of finding the longest string that divides both strings using the GCD of their lengths.
2 min
LeetCode 1072: Flip Columns For Maximum Number of Equal RowsA clear explanation of finding the maximum number of rows that can be made all-equal by flipping columns, using row pattern normalization.
2 min
LeetCode 1073: Adding Negative NumbersA clear explanation of adding two non-positive integers represented as arrays of digits.
3 min
LeetCode 1074: Number of Submatrices That Sum to TargetA clear explanation of counting submatrices with a given sum using 2D prefix sums combined with the subarray sum equals k technique.
3 min
LeetCode 1075: Project Employees IA clear explanation of computing the average years of experience per project using JOIN and AVG aggregation.
1 min
LeetCode 1076: Project Employees IIA clear explanation of finding the project with the most employees using GROUP BY, COUNT, and a subquery for the maximum.
1 min
LeetCode 1077: Project Employees IIIA clear explanation of finding the most experienced employee(s) for each project using a window function or correlated subquery.
2 min
LeetCode 1078: Occurrences After BigramA clear explanation of finding all words that follow a two-word sequence in a text string.
2 min
LeetCode 1079: Letter Tile PossibilitiesA clear explanation of counting all distinct non-empty sequences from a set of letter tiles using backtracking with frequency counting.
2 min
LeetCode 1080: Insufficient Nodes in Root to Leaf PathsA clear explanation of pruning tree nodes where all root-to-leaf paths through them have sum less than a limit, using post-order DFS.
3 min
LeetCode 1081: Smallest Subsequence of Distinct CharactersA clear explanation of finding the lexicographically smallest subsequence with all distinct characters using a greedy stack approach.
2 min
LeetCode 1082: Sales Analysis IA clear explanation of finding the best seller(s) by total price using GROUP BY, SUM, and a subquery for the maximum.
1 min
LeetCode 1083: Sales Analysis IIA clear explanation of finding buyers who bought an iPhone but not an iPad using JOIN and NOT IN filtering.
1 min
LeetCode 1084: Sales Analysis IIIA clear explanation of finding products sold only in the first quarter of 2019 using GROUP BY with date range conditions.
1 min
LeetCode 1085: Sum of Digits in the Minimum NumberA clear explanation of checking if the digit sum of the array minimum is odd or even.
2 min
LeetCode 1086: High FiveA clear explanation of computing each student's top-5 average score using sorting and grouping.
2 min
LeetCode 1087: Brace ExpansionA clear explanation of generating all strings from a brace expansion pattern in lexicographic order using backtracking.
2 min
LeetCode 1088: Confusing Number IIA clear explanation of counting confusing numbers up to n using digit backtracking with rotation validation.
2 min
LeetCode 1089: Duplicate ZerosA clear explanation of duplicating zeros in-place in an array without using extra space by working backwards.
2 min
LeetCode 1090: Largest Values From LabelsA clear explanation of selecting the maximum sum subset under item and label count constraints using a greedy approach.
2 min
LeetCode 1091: Shortest Path in Binary MatrixA clear explanation of finding the shortest path from top-left to bottom-right in a binary matrix using BFS.
3 min
LeetCode 1092: Shortest Common SupersequenceA clear explanation of finding the shortest string containing both input strings as subsequences using LCS dynamic programming.
3 min
LeetCode 1093: Statistics from a Large SampleA clear explanation of computing statistical measures (minimum, maximum, mean, median, mode) from a frequency count array.
2 min
LeetCode 1094: Car PoolingA clear explanation of determining if a car can transport all passengers using a difference array for passenger count tracking.
2 min
LeetCode 1095: Find in Mountain ArrayA clear explanation of finding a target in a mountain array using three binary searches on the interface API.
3 min
LeetCode 1096: Brace Expansion IIA clear explanation of generating all strings from a brace expansion expression using recursive parsing and set union/concatenation.
3 min
LeetCode 1097: Game Play Analysis VA clear explanation of finding the fraction of players retained the day after their first login using self-join and window functions.
2 min
LeetCode 1098: Unpopular BooksA clear explanation of finding books with fewer than 10 sales in the last year that were not sold in the last year using LEFT JOIN and GROUP BY.
2 min
LeetCode 1099: Two Sum Less Than KA clear explanation of finding the maximum sum of two numbers less than k using a two-pointer approach on a sorted array.
2 min
LeetCode 1100: Find K-Length Substrings With No Repeated CharactersA clear explanation of counting substrings of length k with all unique characters using a sliding window.
2 min