<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Matrix on</title><link>https://h30306.github.io/blog/tags/matrix/</link><description>Recent content in Matrix on</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>hwork0511@gmail.com (Wei Yi Chung)</managingEditor><webMaster>hwork0511@gmail.com (Wei Yi Chung)</webMaster><copyright>© 2026 Wei Yi Chung</copyright><lastBuildDate>Wed, 21 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://h30306.github.io/blog/tags/matrix/index.xml" rel="self" type="application/rss+xml"/><item><title>Matrix</title><link>https://h30306.github.io/blog/algorithm/matrix/</link><pubDate>Wed, 21 Oct 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/algorithm/matrix/</guid><description>Transposing and rotating, converting between 2D indices and a 1D sequence, neighbors and diagonals, and spiral traversal with four boundaries</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/algorithm/matrix/featured.png"/></item><item><title>BFS and Graph Traversal</title><link>https://h30306.github.io/blog/algorithm/bfs/</link><pubDate>Tue, 20 Oct 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/algorithm/bfs/</guid><description>Connected components, grid flood fill, multi-source BFS, state-space BFS, shortest cycles, and recursion depth in DFS</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/algorithm/bfs/featured.png"/></item><item><title>LeetCode 827: Making A Large Island</title><link>https://h30306.github.io/blog/leetcode/leetcode-827/</link><pubDate>Sat, 17 Oct 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-827/</guid><description>LeetCode 827 note: label every island and record its size, then for each 0 add the sizes of the distinct neighboring islands plus 1</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-827/featured.png"/></item><item><title>LeetCode 212: Word Search II</title><link>https://h30306.github.io/blog/leetcode/leetcode-212/</link><pubDate>Fri, 16 Oct 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-212/</guid><description>LeetCode 212 note: build a Trie of all words, walk it during the grid DFS, remove words once found, and prune empty nodes</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-212/featured.png"/></item><item><title>LeetCode 2267: Check if There Is a Valid Parentheses String Path</title><link>https://h30306.github.io/blog/leetcode/leetcode-2267/</link><pubDate>Tue, 13 Oct 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-2267/</guid><description>LeetCode 2267 note: the state is (r, c, open balance); the balance can be neither negative nor more than the remaining steps; search the states with BFS / DP and succeed at the end with balance 0</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-2267/featured.png"/></item><item><title>LeetCode 1210: Minimum Moves to Reach Target with Rotations</title><link>https://h30306.github.io/blog/leetcode/leetcode-1210/</link><pubDate>Sat, 12 Sep 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-1210/</guid><description>LeetCode 1210 note: the BFS state is (tail position, orientation), each move checks its own empty cells, and equal step costs need no heap</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-1210/featured.png"/></item><item><title>LeetCode 4046: Minimum Cost Path With At Most K Turns</title><link>https://h30306.github.io/blog/leetcode/leetcode-4046/</link><pubDate>Fri, 11 Sep 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-4046/</guid><description>LeetCode 4046 note: Dijkstra with the last direction and the turns used in the state; for the same cell and direction, an earlier pop is cheaper, and if it also used fewer turns it dominates later states</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-4046/featured.png"/></item><item><title>LeetCode 773: Sliding Puzzle</title><link>https://h30306.github.io/blog/leetcode/leetcode-773/</link><pubDate>Mon, 07 Sep 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-773/</guid><description>LeetCode 773 note: there are only 6! = 720 boards, so flatten each board into a string as a BFS state, with swaps of 0 and a neighbor as the moves</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-773/featured.png"/></item><item><title>LeetCode 499: The Maze III</title><link>https://h30306.github.io/blog/leetcode/leetcode-499/</link><pubDate>Sun, 06 Sep 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-499/</guid><description>LeetCode 499 note: Dijkstra prioritized by (distance, path string), and the ball stops when it rolls over the hole</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-499/featured.png"/></item><item><title>LeetCode 864: Shortest Path to Get All Keys</title><link>https://h30306.github.io/blog/leetcode/leetcode-864/</link><pubDate>Sat, 05 Sep 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-864/</guid><description>LeetCode 864 note: the BFS state is (position, bitmask of keys), so the same cell with different keys is a different node</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-864/featured.png"/></item><item><title>LeetCode 1292: Maximum Side Length of a Square with Sum Less than or Equal to Threshold</title><link>https://h30306.github.io/blog/leetcode/leetcode-1292/</link><pubDate>Sun, 30 Aug 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-1292/</guid><description>LeetCode 1292 note: 2D prefix sums plus binary search on the side length; never mix the two binary search styles</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-1292/featured.png"/></item><item><title>LeetCode 2328: Number of Increasing Paths in a Grid</title><link>https://h30306.github.io/blog/leetcode/leetcode-2328/</link><pubDate>Sun, 30 Aug 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-2328/</guid><description>LeetCode 2328 note: strictly increasing means no cycles; dp[cell] = 1 + Σ dp[larger neighbors], processed from largest to smallest value (or by memoized DFS), summed over all cells</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-2328/featured.png"/></item><item><title>LeetCode 2392: Build a Matrix With Conditions</title><link>https://h30306.github.io/blog/leetcode/leetcode-2392/</link><pubDate>Sat, 01 Aug 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-2392/</guid><description>LeetCode 2392 note: row and column conditions are independent, so run one topological sort for each; put x at its row and column positions, and return an empty matrix if either has a cycle</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-2392/featured.png"/></item><item><title>LeetCode 3548: Equal Sum Grid Partition II</title><link>https://h30306.github.io/blog/leetcode/leetcode-3548/</link><pubDate>Mon, 27 Jul 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-3548/</guid><description>LeetCode 3548 note: try each horizontal cut (transpose for vertical); the difference must equal a cell on the larger side, and a one-row or one-column side can only drop an end cell, while any cell works otherwise</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-3548/featured.png"/></item><item><title>LeetCode 980: Unique Paths III</title><link>https://h30306.github.io/blog/leetcode/leetcode-980/</link><pubDate>Sun, 26 Jul 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-980/</guid><description>LeetCode 980 note: grid backtracking that marks visited cells in place and checks at the end that every empty cell was covered</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-980/featured.png"/></item><item><title>LeetCode 3989: Maximum Consistent Columns in a Grid</title><link>https://h30306.github.io/blog/leetcode/leetcode-3989/</link><pubDate>Mon, 13 Jul 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-3989/</guid><description>LeetCode 3989 note: the kept columns form a subsequence constrained only between neighbors; an LIS-style DP with dp[j] = the longest valid sequence ending at column j</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-3989/featured.png"/></item><item><title>LeetCode 3651: Minimum Cost Path with Teleportations</title><link>https://h30306.github.io/blog/leetcode/leetcode-3651/</link><pubDate>Fri, 26 Jun 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-3651/</guid><description>LeetCode 3651 note: compute layer by layer over teleports; arriving at a cell by teleport costs the previous layer&amp;rsquo;s minimum over cells with value &amp;gt;= it, found with a running minimum after sorting, followed by the usual right / down grid DP</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-3651/featured.png"/></item><item><title>LeetCode 1727: Largest Submatrix With Rearrangements</title><link>https://h30306.github.io/blog/leetcode/leetcode-1727/</link><pubDate>Tue, 23 Jun 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-1727/</guid><description>LeetCode 1727 note: compute each row&amp;rsquo;s heights of consecutive ones above; columns can be reordered, so sort heights descending and the j-th tallest times j + 1 is a candidate</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-1727/featured.png"/></item><item><title>LeetCode 1878: Get Biggest Three Rhombus Sums in a Grid</title><link>https://h30306.github.io/blog/leetcode/leetcode-1878/</link><pubDate>Tue, 23 Jun 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-1878/</guid><description>LeetCode 1878 note: enumerate every top vertex and size, walk the four edges, and keep the three largest distinct sums</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-1878/featured.png"/></item><item><title>LeetCode 3961: Maximize Sum of Device Ratings</title><link>https://h30306.github.io/blog/leetcode/leetcode-3961/</link><pubDate>Thu, 18 Jun 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-3961/</guid><description>LeetCode 3961 note: every device but one donates its smallest unit to the same device; that device&amp;rsquo;s rating becomes the global minimum, so pick the one with the smallest second-smallest value</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-3961/featured.png"/></item><item><title>LeetCode 3905: Multi Source Flood Fill</title><link>https://h30306.github.io/blog/leetcode/leetcode-3905/</link><pubDate>Sun, 19 Apr 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-3905/</guid><description>LeetCode 3905 note: multi-source BFS one layer at a time, collecting the maximum color per cell before writing the layer back</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-3905/featured.png"/></item><item><title>LeetCode 3898: Find the Degree of Each Vertex</title><link>https://h30306.github.io/blog/leetcode/leetcode-3898/</link><pubDate>Sun, 12 Apr 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-3898/</guid><description>LeetCode 3898 note: the number of ones in row i of the adjacency matrix is vertex i&amp;rsquo;s degree</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-3898/featured.png"/></item><item><title>LeetCode 1975: Maximum Matrix Sum</title><link>https://h30306.github.io/blog/leetcode/leetcode-1975/</link><pubDate>Tue, 06 Jan 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-1975/</guid><description>LeetCode 1975 note: minus signs can travel anywhere in pairs but the parity of the negative count never changes; with an odd count, leave one on the smallest absolute value</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-1975/featured.png"/></item><item><title>LeetCode 3195: Find the Minimum Area to Cover All Ones I</title><link>https://h30306.github.io/blog/leetcode/leetcode-3195/</link><pubDate>Fri, 22 Aug 2025 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-3195/</guid><description>LeetCode 3195 note: track the topmost, bottommost, leftmost and rightmost 1; the area is height times width</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-3195/featured.png"/></item><item><title>LeetCode 3643: Flip Square Submatrix Vertically</title><link>https://h30306.github.io/blog/leetcode/leetcode-3643/</link><pubDate>Sun, 10 Aug 2025 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-3643/</guid><description>LeetCode 3643 note: flip only the submatrix rows, swapping the slices of rows x + i and x + k - 1 - i</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-3643/featured.png"/></item><item><title>LeetCode 1222: Queens That Can Attack the King</title><link>https://h30306.github.io/blog/leetcode/leetcode-1222/</link><pubDate>Wed, 30 Jul 2025 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-1222/</guid><description>LeetCode 1222 note: step outward from the king in eight directions; the first queen met in each direction can attack, with queens in a set for lookups</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-1222/featured.png"/></item><item><title>LeetCode 3619: Count Islands With Total Value Divisible by K</title><link>https://h30306.github.io/blog/leetcode/leetcode-3619/</link><pubDate>Sat, 19 Jul 2025 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-3619/</guid><description>LeetCode 3619 note: flood fill each island and sum its values; with up to 10^5 cells, iterate to avoid deep recursion</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-3619/featured.png"/></item><item><title>LeetCode 3070: Count Submatrices with Top-Left Element and Sum Less Than k</title><link>https://h30306.github.io/blog/leetcode/leetcode-3070/</link><pubDate>Sun, 03 Mar 2024 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-3070/</guid><description>LeetCode 3070 note: submatrices containing the top-left corner are exactly the 2D prefix sums P[i][j]; count those &amp;lt;= k</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-3070/featured.png"/></item><item><title>LeetCode 3071: Minimum Operations to Write the Letter Y on a Grid</title><link>https://h30306.github.io/blog/leetcode/leetcode-3071/</link><pubDate>Sun, 03 Mar 2024 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-3071/</guid><description>LeetCode 3071 note: count each value on and off the Y, enumerate the Y value a and background value b (a != b), and take the fewest cells to change</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-3071/featured.png"/></item><item><title>LeetCode 240: Search a 2D Matrix II</title><link>https://h30306.github.io/blog/leetcode/leetcode-240/</link><pubDate>Sat, 12 Nov 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-240/</guid><description>LeetCode 240 note: start at the top-right corner, moving left when larger and down when smaller, eliminating a row or column each step</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-240/featured.png"/></item><item><title>LeetCode 48: Rotate Image</title><link>https://h30306.github.io/blog/leetcode/leetcode-48/</link><pubDate>Mon, 31 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-48/</guid><description>LeetCode 48 note: rotating 90 degrees clockwise is a transpose followed by reversing each row, both in place</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-48/featured.png"/></item><item><title>LeetCode 417: Pacific Atlantic Water Flow</title><link>https://h30306.github.io/blog/leetcode/leetcode-417/</link><pubDate>Sun, 30 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-417/</guid><description>LeetCode 417 note: walk inward from each ocean&amp;rsquo;s shore to cells no lower than the current one; cells reached from both oceans are the answer</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-417/featured.png"/></item><item><title>LeetCode 73: Set Matrix Zeroes</title><link>https://h30306.github.io/blog/leetcode/leetcode-73/</link><pubDate>Tue, 25 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-73/</guid><description>LeetCode 73 note: record which rows and columns contain a 0 first, then update afterward; the follow-up uses the first row and column as markers</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-73/featured.png"/></item><item><title>LeetCode 74: Search a 2D Matrix</title><link>https://h30306.github.io/blog/leetcode/leetcode-74/</link><pubDate>Tue, 25 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-74/</guid><description>LeetCode 74 note: each row continues the previous one in sorted order, so binary search it as a 1-D array of length m × n, mapping mid to (mid // n, mid % n)</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-74/featured.png"/></item><item><title>LeetCode 54: Spiral Matrix</title><link>https://h30306.github.io/blog/leetcode/leetcode-54/</link><pubDate>Sat, 22 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-54/</guid><description>LeetCode 54 note: keep four boundaries and walk right, down, left and up, shrinking a boundary after each side</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-54/featured.png"/></item><item><title>LeetCode 59: Spiral Matrix II</title><link>https://h30306.github.io/blog/leetcode/leetcode-59/</link><pubDate>Sat, 22 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-59/</guid><description>LeetCode 59 note: keep four boundaries as in LC 54, but fill in 1 to n² instead of reading</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-59/featured.png"/></item><item><title>LeetCode 36: Valid Sudoku</title><link>https://h30306.github.io/blog/leetcode/leetcode-36/</link><pubDate>Fri, 21 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-36/</guid><description>LeetCode 36 note: each digit may appear once per row, column and 3 × 3 box; put (digit, row), (digit, column) and (digit, box) keys into one set</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-36/featured.png"/></item><item><title>LeetCode 892: Surface Area of 3D Shapes</title><link>https://h30306.github.io/blog/leetcode/leetcode-892/</link><pubDate>Sat, 24 Sep 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-892/</guid><description>LeetCode 892 note: a stack of v cubes has 4v + 2 faces; subtract 2 × min for each overlap with the stacks above and to the left</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-892/featured.png"/></item><item><title>LeetCode 883: Projection Area of 3D Shapes</title><link>https://h30306.github.io/blog/leetcode/leetcode-883/</link><pubDate>Wed, 21 Sep 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-883/</guid><description>LeetCode 883 note: the top view counts nonzero cells, and the front and side views sum each row&amp;rsquo;s and each column&amp;rsquo;s maximum</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-883/featured.png"/></item><item><title>LeetCode 867: Transpose Matrix</title><link>https://h30306.github.io/blog/leetcode/leetcode-867/</link><pubDate>Sat, 17 Sep 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-867/</guid><description>LeetCode 867 note: the transpose is n × m with res[j][i] = matrix[i][j]; in Python, zip(*matrix)</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-867/featured.png"/></item><item><title>LeetCode 832: Flipping an Image</title><link>https://h30306.github.io/blog/leetcode/leetcode-832/</link><pubDate>Thu, 15 Sep 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-832/</guid><description>LeetCode 832 note: reverse each row and invert its bits, which two pointers can do at once</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-832/featured.png"/></item><item><title>LeetCode 766: Toeplitz Matrix</title><link>https://h30306.github.io/blog/leetcode/leetcode-766/</link><pubDate>Tue, 06 Sep 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-766/</guid><description>LeetCode 766 note: every diagonal is constant exactly when each cell equals its upper-left neighbor</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-766/featured.png"/></item><item><title>LeetCode 733: Flood Fill</title><link>https://h30306.github.io/blog/leetcode/leetcode-733/</link><pubDate>Sat, 03 Sep 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-733/</guid><description>LeetCode 733 note: DFS or BFS from the start, recoloring 4-directional cells that share the start&amp;rsquo;s original color; return immediately if the colors are equal</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-733/featured.png"/></item><item><title>LeetCode 661: Image Smoother</title><link>https://h30306.github.io/blog/leetcode/leetcode-661/</link><pubDate>Mon, 29 Aug 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-661/</guid><description>LeetCode 661 note: each cell becomes the floored average of the existing cells in its 3 × 3 neighborhood, written into a new matrix</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-661/featured.png"/></item><item><title>LeetCode 566: Reshape the Matrix</title><link>https://h30306.github.io/blog/leetcode/leetcode-566/</link><pubDate>Sat, 27 Aug 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-566/</guid><description>LeetCode 566 note: return the original if the element counts differ; otherwise element k goes to (k // c, k % c)</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-566/featured.png"/></item><item><title>LeetCode 463: Island Perimeter</title><link>https://h30306.github.io/blog/leetcode/leetcode-463/</link><pubDate>Wed, 24 Aug 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-463/</guid><description>LeetCode 463 note: each land cell contributes 4 edges, minus 2 for each land neighbor above or to the left</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-463/featured.png"/></item></channel></rss>