Skip to content

LeetCode 09xx

LeetCode practice notes for problems 900 through 999, including A clear explanation of designing an iterator over a run-length encoded sequence without expanding it.

#TitleDifficultyDescription
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.
LeetCode 900: RLE IteratorA clear explanation of designing an iterator over a run-length encoded sequence without expanding it.
5 min
LeetCode 901: Online Stock SpanA clear explanation of Online Stock Span using a monotonic decreasing stack with accumulated spans.
6 min
LeetCode 902: Numbers At Most N Given Digit SetA clear explanation of counting numbers less than or equal to N using digit-by-digit construction and combinatorics.
5 min
LeetCode 903: Valid Permutations for DI SequenceA clear explanation of counting valid DI permutations using dynamic programming and prefix sums.
6 min
LeetCode 904: Fruit Into BasketsA clear explanation of Fruit Into Baskets using a sliding window with at most two distinct fruit types.
5 min
LeetCode 905: Sort Array By ParityA clear explanation of sorting an array by parity using a two-pointer partition method.
4 min
LeetCode 906: Super PalindromesA clear explanation of counting super-palindromes by generating palindromic roots and checking their squares.
6 min
LeetCode 907: Sum of Subarray MinimumsA clear explanation of summing subarray minimums using a monotonic stack and contribution counting.
5 min
LeetCode 908: Smallest Range IA clear explanation of minimizing an array score after each value can move by at most k.
4 min
LeetCode 909: Snakes and LaddersA clear explanation of Snakes and Ladders using breadth-first search over board squares.
6 min
LeetCode 910: Smallest Range IIA clear explanation of minimizing the array range after adding either +k or -k to every element.
4 min
LeetCode 911: Online ElectionA clear explanation of Online Election using preprocessing and binary search over vote times.
5 min
LeetCode 912: Sort an ArrayA clear explanation of sorting an array without built-in sorting using merge sort.
4 min
LeetCode 913: Cat and MouseA clear explanation of Cat and Mouse using game states, reverse BFS, and topological propagation.
7 min
LeetCode 914: X of a Kind in a Deck of CardsA clear explanation of checking whether card counts share a common group size using the greatest common divisor.
5 min
LeetCode 915: Partition Array into Disjoint IntervalsA clear explanation of finding the smallest left partition using prefix maximums and suffix minimums.
4 min
LeetCode 916: Word SubsetsA clear explanation of finding universal words by merging character frequency requirements from words2.
5 min
LeetCode 917: Reverse Only LettersA clear explanation of reversing only English letters while keeping all non-letter characters fixed.
4 min
LeetCode 918: Maximum Sum Circular SubarrayA clear explanation of finding the maximum circular subarray sum using Kadane's algorithm.
5 min
LeetCode 919: Complete Binary Tree InserterA clear explanation of maintaining a complete binary tree inserter using level-order indexing.
5 min
LeetCode 920: Number of Music PlaylistsA clear explanation of counting valid music playlists using dynamic programming over playlist length and unique songs used.
6 min
LeetCode 921: Minimum Add to Make Parentheses ValidA clear explanation of making a parentheses string valid using greedy counting.
4 min
LeetCode 922: Sort Array By Parity IIA clear explanation of placing even numbers at even indices and odd numbers at odd indices using two pointers.
5 min
LeetCode 923: 3Sum With MultiplicityA clear explanation of counting index triplets with duplicate values using frequency counts and combinatorics.
6 min
LeetCode 924: Minimize Malware SpreadA clear explanation of minimizing malware spread by analyzing connected components with Union Find.
7 min
LeetCode 925: Long Pressed NameA clear explanation of the Long Pressed Name problem using a two-pointer scan.
5 min
LeetCode 926: Flip String to Monotone IncreasingA clear explanation of solving Flip String to Monotone Increasing with a one-pass dynamic programming approach.
5 min
LeetCode 927: Three Equal PartsA clear explanation of solving Three Equal Parts by counting ones, locating the three binary patterns, and comparing them in one pass.
8 min
LeetCode 928: Minimize Malware Spread IIA clear explanation of solving Minimize Malware Spread II by removing each infected node and simulating the final malware spread.
7 min
LeetCode 929: Unique Email AddressesA clear explanation of solving Unique Email Addresses using string normalization and a hash set.
4 min
LeetCode 930: Binary Subarrays With SumA clear explanation of solving Binary Subarrays With Sum using prefix sums and a frequency map.
5 min
LeetCode 931: Minimum Falling Path SumA clear explanation of solving Minimum Falling Path Sum using dynamic programming over matrix rows.
6 min
LeetCode 932: Beautiful ArrayA clear explanation of solving Beautiful Array using divide and conquer with odd and even transformations.
6 min
LeetCode 933: Number of Recent CallsA clear explanation of solving Number of Recent Calls using a queue as a sliding time window.
5 min
LeetCode 934: Shortest BridgeA clear explanation of solving Shortest Bridge using DFS to mark one island and BFS to expand toward the other island.
6 min
LeetCode 935: Knight DialerA clear explanation of solving Knight Dialer using dynamic programming over the phone keypad graph.
5 min
LeetCode 936: Stamping The SequenceA clear explanation of solving Stamping The Sequence using reverse simulation and BFS-style processing.
6 min
LeetCode 937: Reorder Data in Log FilesA clear explanation of solving Reorder Data in Log Files using custom sorting and stable handling of digit logs.
5 min
LeetCode 938: Range Sum of BSTA clear explanation of solving Range Sum of BST using DFS with binary search tree pruning.
5 min
LeetCode 939: Minimum Area RectangleA clear explanation of solving Minimum Area Rectangle using diagonal point pairs and constant-time point lookup.
5 min
LeetCode 940: Distinct Subsequences IIA clear explanation of solving Distinct Subsequences II using dynamic programming and last occurrence tracking.
5 min
LeetCode 941: Valid Mountain ArrayA clear explanation of solving Valid Mountain Array by walking up the increasing slope and then down the decreasing slope.
5 min
LeetCode 942: DI String MatchA clear explanation of solving DI String Match using a greedy two-pointer construction.
5 min
LeetCode 943: Find the Shortest SuperstringA clear explanation of solving Find the Shortest Superstring using pairwise overlaps and bitmask dynamic programming.
7 min
LeetCode 944: Delete Columns to Make SortedA clear explanation of solving Delete Columns to Make Sorted by checking each column independently.
4 min
LeetCode 945: Minimum Increment to Make Array UniqueA clear explanation of solving Minimum Increment to Make Array Unique by sorting and greedily assigning the next available value.
4 min
LeetCode 946: Validate Stack SequencesA clear explanation of solving Validate Stack Sequences by simulating stack push and pop operations.
5 min
LeetCode 947: Most Stones Removed with Same Row or ColumnA clear explanation of solving Most Stones Removed with Same Row or Column using connected components and union-find.
5 min
LeetCode 948: Bag of TokensA clear explanation of solving Bag of Tokens using sorting, greedy choices, and two pointers.
5 min
LeetCode 949: Largest Time for Given DigitsA clear explanation of solving Largest Time for Given Digits by checking all permutations of four digits.
4 min
LeetCode 950: Reveal Cards In Increasing OrderA clear explanation of solving Reveal Cards In Increasing Order using sorting and queue simulation over indices.
5 min
LeetCode 951: Flip Equivalent Binary TreesA clear explanation of checking whether two binary trees are equivalent after swapping left and right children at any number of nodes.
6 min
LeetCode 952: Largest Component Size by Common FactorA clear explanation of solving Largest Component Size by Common Factor using prime factorization and union find.
7 min
LeetCode 953: Verifying an Alien DictionaryA clear explanation of checking whether words are sorted according to a custom alien alphabet order.
5 min
LeetCode 954: Array of Doubled PairsA clear explanation of checking whether an array can be reordered into pairs where one number is double the other.
5 min
LeetCode 955: Delete Columns to Make Sorted IIA clear explanation of deleting the minimum number of columns so rows become lexicographically sorted.
6 min
LeetCode 956: Tallest BillboardA clear explanation of solving Tallest Billboard using dynamic programming over height differences.
6 min
LeetCode 957: Prison Cells After N DaysA clear explanation of simulating prison cell transitions efficiently using cycle detection.
5 min
LeetCode 958: Check Completeness of a Binary TreeA clear explanation of checking whether a binary tree is complete using level-order traversal.
5 min
LeetCode 959: Regions Cut By SlashesA clear explanation of counting regions formed by slashes using union find over four triangles per cell.
7 min
LeetCode 960: Delete Columns to Make Sorted IIIA clear explanation of deleting the minimum number of columns so every remaining row is individually sorted.
5 min
LeetCode 961: N-Repeated Element in Size 2N ArrayA clear explanation of finding the element repeated N times using a hash set.
4 min
LeetCode 962: Maximum Width RampA clear explanation of finding the maximum width ramp using a monotonic decreasing stack.
6 min
LeetCode 963: Minimum Area Rectangle IIA clear explanation of finding the minimum-area rectangle from points when the rectangle may be rotated.
6 min
LeetCode 964: Least Operators to Express NumberA clear explanation of expressing a target using the fewest operators with repeated uses of x.
6 min
LeetCode 965: Univalued Binary TreeA clear explanation of checking whether every node in a binary tree has the same value.
4 min
LeetCode 966: Vowel SpellcheckerA clear explanation of implementing a spellchecker with exact, case-insensitive, and vowel-error matching.
5 min
LeetCode 967: Numbers With Same Consecutive DifferencesA clear explanation of generating all n-digit numbers whose adjacent digits differ by k.
5 min
LeetCode 968: Binary Tree CamerasA clear explanation of placing the minimum number of cameras in a binary tree using postorder DFS.
6 min
LeetCode 969: Pancake SortingA clear explanation of sorting an array using prefix reversals by repeatedly placing the largest remaining value.
5 min
LeetCode 970: Powerful IntegersA clear explanation of generating all powerful integers using bounded powers and a set.
5 min
LeetCode 971: Flip Binary Tree To Match Preorder TraversalA clear explanation of matching a binary tree preorder traversal by greedily flipping nodes.
6 min
LeetCode 972: Equal Rational NumbersA clear explanation of comparing rational numbers written as decimal strings with optional repeating parts.
5 min
LeetCode 973: K Closest Points to OriginA clear explanation of returning the k closest points to the origin using squared distance and sorting.
4 min
LeetCode 974: Subarray Sums Divisible by KA clear explanation of counting subarrays whose sum is divisible by k using prefix sums and remainder frequencies.
5 min
LeetCode 975: Odd Even JumpA clear explanation of counting good starting indices using next-jump preprocessing and dynamic programming.
7 min
LeetCode 976: Largest Perimeter TriangleA clear explanation of finding the largest valid triangle perimeter using sorting and a greedy scan.
5 min
LeetCode 977: Squares of a Sorted ArrayA clear explanation of sorting squared values from a sorted array using two pointers.
5 min
LeetCode 978: Longest Turbulent SubarrayA clear explanation of finding the longest subarray whose adjacent comparisons alternate between greater-than and less-than.
6 min
LeetCode 979: Distribute Coins in Binary TreeA clear explanation of balancing coins in a binary tree using postorder DFS and subtree coin balance.
6 min
LeetCode 980: Unique Paths IIIA clear explanation of counting all paths from start to end that visit every non-obstacle square exactly once using backtracking.
7 min
LeetCode 981: Time Based Key-Value StoreA clear explanation of designing a time-based key-value store using a hash map and binary search.
6 min
LeetCode 982: Triples with Bitwise AND Equal To ZeroA clear explanation of counting ordered triples whose bitwise AND is zero using pairwise AND counts.
5 min
LeetCode 983: Minimum Cost For TicketsA clear explanation of finding the cheapest way to cover all travel days using dynamic programming.
6 min
LeetCode 984: String Without AAA or BBBA clear explanation of constructing a string with exact counts of a and b while avoiding three equal consecutive characters.
5 min
LeetCode 985: Sum of Even Numbers After QueriesA clear explanation of maintaining the sum of even numbers after each array update.
5 min
LeetCode 986: Interval List IntersectionsA clear explanation of finding intersections between two sorted disjoint interval lists using two pointers.
5 min
LeetCode 987: Vertical Order Traversal of a Binary TreeA clear explanation of vertical tree traversal using coordinates, DFS, sorting, and column grouping.
5 min
LeetCode 988: Smallest String Starting From LeafA clear explanation of finding the lexicographically smallest leaf-to-root string in a binary tree using DFS.
5 min
LeetCode 989: Add to Array-Form of IntegerA clear explanation of adding an integer to an array-form number using digit-by-digit simulation.
5 min
LeetCode 990: Satisfiability of Equality EquationsA clear explanation of checking equality and inequality constraints using union-find.
5 min
LeetCode 991: Broken CalculatorA clear explanation of finding the minimum operations by working backward from target to startValue.
4 min
LeetCode 992: Subarrays with K Different IntegersA clear explanation of counting subarrays with exactly k distinct integers using the at-most-k sliding window trick.
6 min
LeetCode 993: Cousins in Binary TreeA clear explanation of checking whether two binary tree nodes are cousins using BFS with parent tracking.
6 min
LeetCode 994: Rotting OrangesA clear explanation of finding the minimum time for all oranges to rot using multi-source BFS.
7 min
LeetCode 995: Minimum Number of K Consecutive Bit FlipsA clear explanation of making all bits equal to 1 using greedy left-to-right flips and a sliding window flip parity.
5 min
LeetCode 996: Number of Squareful ArraysA clear explanation of counting unique permutations where every adjacent pair sums to a perfect square using backtracking.
6 min
LeetCode 997: Find the Town JudgeA clear explanation of identifying the town judge using trust indegree and outdegree counts.
5 min
LeetCode 998: Maximum Binary Tree IIA clear explanation of inserting a value into a maximum binary tree by following the right spine.
5 min
LeetCode 999: Available Captures for RookA clear explanation of counting how many pawns a rook can capture by scanning four directions on a chessboard.
5 min