LeetCode 921: Minimum Add to Make Parentheses Valid
A clear explanation of making a parentheses string valid using greedy counting.
37 notes
A clear explanation of making a parentheses string valid using greedy counting.
A clear explanation of finding universal words by merging character frequency requirements from words2.
A clear explanation of finding uncommon words by counting word frequencies across both sentences.
A clear explanation of Task Scheduler using frequency counting and the greedy block formula.
A clear explanation of identifying the town judge using trust indegree and outdegree counts.
A clear explanation of counting unique permutations where every adjacent pair sums to a perfect square using backtracking.
A clear explanation of counting subarrays with exactly k distinct integers using the at-most-k sliding window trick.
A clear explanation of counting ordered triples whose bitwise AND is zero using pairwise AND counts.
A counting solution for computing how many directed friend requests are allowed by age rules.
A hash map and string parsing solution for finding the most frequent non-banned word in a paragraph.
A hash map solution for accumulating visit counts across domains and all of their parent subdomains.
Count axis-aligned rectangles whose four corners are 1 using column-pair frequency counting.
Find the shortest word that contains all required license plate letters using frequency counting.
Find the shortest contiguous subarray with the same degree as the whole array using frequency counts and first occurrence indices.
Count substrings with equal consecutive groups of 0s and 1s using run lengths.
A clear explanation of checking whether two strings are anagrams using character frequency counting.
A detailed explanation of counting how many times digit one appears from 0 to n using positional digit analysis.
A clear explanation of finding all elements that appear more than n/3 times using the extended Boyer-Moore voting algorithm.
A clear hash map solution for finding the longest subsequence whose maximum and minimum differ by exactly one.
A clear explanation of Student Attendance Record II using dynamic programming over absence count and late streak.
A clear explanation of counting black lonely pixels using row counts, column counts, and duplicate row patterns.
A clear explanation of counting unique pairs whose absolute difference is k using frequency counting.
A clear explanation of counting black pixels that are alone in both their row and column.
A clear explanation of counting the perimeter of an island in a grid by adding land-cell edges and subtracting shared edges.
A clear explanation of counting zero-sum tuples across four arrays using pair sums and a hash map.
A clear explanation of reconstructing digits from shuffled English words using character frequency counts and unique identifying letters.
A clear explanation of counting battleships in a board using one-pass observation without modifying the grid.
A clear explanation of finding the longest palindrome length that can be built from given letters using character counts.
A clear explanation of finding the first non-repeating character in a string using character frequency counting.
A clear explanation of checking whether one string can be constructed from another using character frequency counting.
A counting solution for producing the Bulls and Cows hint while handling duplicate digits correctly.
A clear explanation of the Palindrome Permutation problem using character parity counting.
A clear explanation of finding the element that appears more than half the time using Boyer-Moore voting.
Track frequency counts for keys using a hash map that increments a counter on each insertion of an existing key.
Early counting through marks, objects, and physical recording systems.
How early humans developed counting, measurement, and basic mathematical thinking before formal notation.
Counting, arrangement, structure, and extremal behavior of finite and discrete systems.