LeetCode 832: Flipping an Image
A clear explanation of the Flipping an Image problem using row reversal, bit inversion, and an in-place two-pointer method.
42 notes
A clear explanation of the Flipping an Image problem using row reversal, bit inversion, and an in-place two-pointer method.
A clear explanation of counting distinct bitwise OR results from all non-empty subarrays using rolling sets.
A clear explanation of making all bits equal to 1 using greedy left-to-right flips and a sliding window flip parity.
A clear explanation of counting ordered triples whose bitwise AND is zero using pairwise AND counts.
A clear explanation of finding the maximum distance between adjacent set bits in a binary representation.
A clear explanation of maximizing a binary matrix score using greedy row and column flips.
A math and bit manipulation solution for deciding whether Alice wins the XOR removal game.
A clear explanation of transforming a binary board into a chessboard using feasibility checks and minimum row and column swaps.
A clear explanation of finding the kth symbol in the grammar sequence using recursion and the parent-child relationship.
A clear explanation of counting numbers whose binary representation has a prime number of set bits.
A clear explanation of converting a range of IPv4 addresses into the shortest list of CIDR blocks using greedy bit manipulation.
A clear explanation of determining whether the last character must be a one-bit character using greedy parsing.
Check whether every adjacent bit in a positive integer's binary representation is different.
A clear explanation of counting possible bulb states after pressing four toggle buttons exactly presses times.
A clear explanation of determining whether an integer is a power of two using binary properties and bit manipulation.
A clear digit dynamic programming solution for counting numbers whose binary representation does not contain consecutive ones.
A clear explanation of computing the total Hamming distance across all pairs by counting different bits column by column.
A clear explanation of finding the bitwise complement of a positive integer using a binary mask.
A clear explanation of computing the Hamming distance between two integers using XOR and bit counting.
A clear explanation of finding the maximum XOR of two numbers using greedy bit prefixes.
A clear explanation of finding the shortest abbreviation that does not conflict with any dictionary word using bit masks.
A clear explanation of converting integers to hexadecimal using bit manipulation and two's complement representation.
A clear explanation of the Binary Watch problem using bit counting over all valid times.
A clear explanation of reducing an integer to 1 with the fewest operations using greedy bit decisions.
A clear explanation of validating a byte sequence as UTF-8 using bit masks and a continuation-byte counter.
A clear explanation of finding the extra character added to a shuffled string using counting and XOR.
A clear explanation of adding two integers without using plus or minus by using XOR, AND, carry, and a 32-bit mask.
A clear explanation of Power of Four using bit manipulation and binary properties.
A clear explanation of Counting Bits using dynamic programming and bit manipulation.
A clear explanation of Generalized Abbreviation using backtracking to choose whether each character is kept or abbreviated.
A clear explanation of Maximum Product of Word Lengths using bit masks to test disjoint character sets efficiently.
A clear explanation of the Missing Number problem using sum formula and XOR.
A clear explanation of the Single Number III problem using XOR partitioning to isolate the two unique numbers.
A clear explanation of finding the bitwise AND of every number in an inclusive range using the common binary prefix.
A detailed guide to solving Subsets II with sorting, backtracking, and duplicate skipping.
A detailed guide to solving Gray Code using the binary-to-Gray-code formula.
A detailed guide to solving Subsets with backtracking and the include-or-skip recursion idea.
A clear explanation of counting set bits in an integer using bit manipulation and Brian Kernighan's algorithm.
A clear explanation of reversing the bits of a 32-bit integer using bit manipulation.
Find the number that appears once when every other number appears three times using bit counting or finite-state bit manipulation.
Find the only number that appears once using the XOR operator, while every other number appears exactly twice.
A clear explanation of integer division without using multiplication, division, or modulo, using repeated doubling with bit shifts.