LeetCode 835: Image Overlap
A clear explanation of the Image Overlap problem using translation vectors and frequency counting.
55 notes
A clear explanation of the Image Overlap problem using translation vectors and frequency counting.
A clear explanation of the Find And Replace in String problem using simultaneous replacement, source matching, and a replacement map.
A clear explanation of Count Unique Characters of All Substrings using contribution counting with previous and next occurrences.
A clear explanation of Task Scheduler using frequency counting and the greedy block formula.
A clear explanation of grouping strings by their shifting sequence using normalized hash keys.
A clear explanation of the Strobogrammatic Number problem using digit rotation rules and two pointers.
A clear explanation of the Shortest Word Distance II problem using preprocessing and two pointers.
A clear explanation of solving Distinct Subsequences II using dynamic programming and last occurrence tracking.
A clear explanation of solving Binary Subarrays With Sum using prefix sums and a frequency map.
A dynamic programming solution for counting binary trees where every non-leaf node is the product of its children.
A hash map and string parsing solution for finding the most frequent non-banned word in a paragraph.
A BFS solution for finding the minimum number of buses needed to travel from a source stop to a target stop.
A hash map solution for accumulating visit counts across domains and all of their parent subdomains.
A clear explanation of counting how many words are subsequences of a string using waiting queues.
A clear explanation of rearranging a string so that selected characters follow a custom order.
A clear explanation of finding the minimum possible number of rabbits using counting and greedy grouping.
Parse a chemical formula with nested parentheses, atom names, and multipliers using recursive descent.
Find the shortest contiguous subarray with the same degree as the whole array using frequency counts and first occurrence indices.
Find the k most frequent words using frequency counting and custom sorting by count and lexicographical order.
Compute the total importance of an employee and all direct and indirect subordinates using a hash map and depth-first search.
Design a map that supports key-value insertion and prefix-sum queries using a hash map and trie.
Design a dictionary that can check whether a word can match a stored word after changing exactly one character.
A clear explanation of computing all root-to-leaf path sums from a compact three-digit binary tree encoding.
A clear explanation of deciding whether a sorted array can be split into consecutive subsequences of length at least three.
A clear explanation of finding duplicate binary tree subtrees using postorder traversal, serialization, and a hash map.
A trie-based design for returning the top three historical sentences for a typed prefix.
A design solution for a small Excel-like spreadsheet that supports set, get, and dynamic sum formulas.
A clear hash map solution for finding common strings with the smallest index sum.
A clear hash map solution for finding the longest subsequence whose maximum and minimum differ by exactly one.
A clear design guide for implementing an in-memory file system with directory listing, directory creation, file append, and file read operations.
A clear graph traversal solution for finding all processes terminated when killing a target process.
A clear explanation of Permutation in String using a fixed-size sliding window and character frequency counts.
A clear explanation of Subarray Sum Equals K using prefix sums and a hash map to count matching subarrays in linear time.
A clear explanation of Brick Wall using prefix sums and a hash map to find the best vertical cut position.
A clear explanation of finding the longest contiguous subarray with equal numbers of 0 and 1 using prefix sums and a hash map.
A clear explanation of detecting a subarray whose sum is a multiple of k using prefix sums and modular arithmetic.
A clear explanation of randomly flipping zero cells in a matrix without repetition using hash mapping and virtual swapping.
A clear explanation of finding the most frequent subtree sum in a binary tree using postorder DFS and a frequency map.
A clear explanation of assigning athlete ranks from scores using sorting while preserving original indices.
A clear explanation of minimizing debt-settlement transactions using net balances, backtracking, and memoization-style pruning.
A clear explanation of designing an LFU cache with O(1) average get and put operations.
A clear explanation of counting zero-sum tuples across four arrays using pair sums and a hash map.
A clear explanation of sorting characters by decreasing frequency using a hash map and sorting.
A clear explanation of checking nearby indices with nearby values using a sliding window and bucket hashing.
A clear explanation of detecting whether equal values appear within distance k using a hash map or sliding window set.
A clear explanation of checking whether two strings follow the same character mapping pattern.
A detailed guide to solving Minimum Window Substring with a sliding window and frequency counters.
Find the maximum number of points lying on the same straight line using slope counting and normalization.
Design an LRU cache with O(1) get and put operations using a hash map and doubly linked list.
Create a deep copy of a linked list with next and random pointers using hash maps or interleaved node cloning.
Create a deep copy of a connected undirected graph using DFS and a hash map from original nodes to cloned nodes.
A clear explanation of rebuilding a binary tree from inorder and postorder traversals using recursion and an index map.
A clear explanation of rebuilding a binary tree from preorder and inorder traversals using recursion and an index map.
A clear explanation of the Two Sum problem using brute force first, then an optimized hash map solution.
Store only non-default values from a large logical array.