LeetCode 74: Search a 2D Matrix

You are given an m x n integer matrix matrix and an integer target. Return True if target is in the matrix; otherwise, return False. The matrix satisfies two conditions: Every row is sorted in non-decreasing order. The first integer of each row is strictly greater than the last integer of the previous row. The required time complexity is O(log(m * n)). For example, consider this matrix: 1 3 5 7 10 11 16 20 23 30 34 60 When target = 3, return True. When target = 13, return False. The constraints are: ...

August 13, 2026 · 11 min · map[name:Jeanphilo]

LeetCode 200: Number of Islands With Union-Find

Subtitle / Summary Do not start this problem by memorizing a Union-Find template. Start from the pressure: each land cell looks like one island at first, but adjacent land cells must collapse into one connected component. Reading time: 10-12 min Tags: Hot100, Union-Find, DSU, matrix, connected components SEO keywords: LeetCode 200, Number of Islands, Union-Find, DSU, connected components Meta description: A pressure-first Python guide to LeetCode 200 that derives land-only count, 2D-to-1D ids, Union-Find merges, and the final runnable solution. Problem Requirement You are given an m x n 2D character grid: ...

July 2, 2026 · 7 min · map[name:Jeanphilo]

Hot100: Spiral Matrix (Boundary Shrinking Simulation ACERS Guide)

Subtitle / Summary Spiral traversal looks like “just printing in a fancy order”, but the real difficulty is getting boundaries and invariants right. This ACERS guide gives a reusable boundary-shrinking template and runnable multi-language solutions. Reading time: 12–15 min Tags: Hot100, matrix, simulation, boundary shrinking SEO keywords: Hot100, Spiral Matrix, clockwise traversal, boundary shrinking, LeetCode 54 Meta description: O(mn) spiral order traversal using boundary shrinking, with pitfalls, engineering scenarios, and runnable code. A — Algorithm Problem Restatement Given an m × n matrix matrix, return all elements in clockwise spiral order. ...

February 3, 2026 · 13 min · map[name:Jeanphilo]