LeetCode 133: Clone Graph Hash Map + DFS/BFS ACERS Guide

Subtitle / Summary Clone Graph is not a traversal-only problem. The real challenge is preserving graph structure while avoiding duplicate copies in the presence of cycles. The stable solution is a traversal plus a hash map from original nodes to cloned nodes. Reading time: 12-15 min Tags: graph, dfs, bfs, hash map, deep copy SEO keywords: Clone Graph, graph deep copy, DFS, BFS, LeetCode 133 Meta description: Deep-copy an undirected graph with a node-to-node map, explaining why memoization is mandatory and how DFS/BFS versions work, with runnable code in six languages. Target Readers LeetCode learners practicing graph traversal and deep-copy patterns Engineers who duplicate object graphs, workflow graphs, or topology graphs Developers who want one reusable template for “clone with cycles” Background / Motivation Many “copy” problems are actually identity-preservation problems. ...

March 19, 2026 · 11 min · map[name:Jeanphilo]

LeetCode 2089: Find Target Indices After Sorting Array ACERS Guide

Subtitle / Summary This problem is a useful bridge between sorting and binary search. After sorting the array, all copies of target become one contiguous block, and the answer is simply every index inside that block. Reading time: 10-12 min Tags: sorting, binary search, range location SEO keywords: Find Target Indices After Sorting Array, LeetCode 2089, lower bound, upper bound Meta description: Sort the array, use lower and upper bounds to find the target block, and return every matching index, with tradeoffs, engineering scenarios, and runnable implementations in six languages. Target Readers Learners connecting sorting with lower/upper bound search Engineers who need all positions of one value after offline sorting Interview candidates reviewing how contiguous blocks form in sorted data Background / Motivation The input array is not sorted, so we cannot apply binary search immediately. But once we sort it, every copy of the same value becomes one continuous segment. ...

March 18, 2026 · 8 min · map[name:Jeanphilo]

LeetCode 2529: Maximum Count of Positive Integer and Negative Integer ACERS Guide

Subtitle / Summary This problem is a compact exercise in boundary counting. Because the array is already sorted, you do not count negatives and positives one by one; you find where zero starts and where zero ends, then compute both counts from those boundaries. Reading time: 10-12 min Tags: binary search, counting, sorted array, boundaries SEO keywords: Maximum Count of Positive Integer and Negative Integer, LeetCode 2529, boundary counting Meta description: Use lower-bound and upper-bound binary search around zero to count negatives and positives in a sorted array, with correctness reasoning, engineering scenarios, and runnable implementations in six languages. Target Readers Learners practicing boundary search beyond exact-match lookup Engineers who count segments in sorted data Interview candidates learning how lower and upper bounds produce counts Background / Motivation The input is already sorted. That changes the problem completely. ...

March 18, 2026 · 9 min · map[name:Jeanphilo]

LeetCode 34: Find First and Last Position of Element in Sorted Array ACERS Guide

Subtitle / Summary This problem is the standard upgrade from “find one target” to “find the whole target block.” The clean solution is not a special-case binary search, but two boundary searches: lower bound for the start and upper bound for the end. Reading time: 12-14 min Tags: binary search, lower bound, upper bound, range query SEO keywords: Search Range, lower bound, upper bound, LeetCode 34 Meta description: Use lower-bound and upper-bound binary search to find the first and last positions of a target in a sorted array, with pitfalls, engineering scenarios, and runnable implementations in six languages. Target Readers Learners who already know basic binary search but struggle with boundary problems Engineers who query sorted logs, timestamps, or grouped IDs Interview candidates who want one reusable range-search template Background / Motivation Finding a single target in a sorted array is the easy version. Real systems often need the full range: ...

March 18, 2026 · 10 min · map[name:Jeanphilo]

LeetCode 35: Search Insert Position Lower-Bound Binary Search ACERS Guide

Subtitle / Summary Search Insert Position is the cleanest lower-bound problem in LeetCode. If you can reliably find the first index where nums[i] >= target, you already have the core template for insert positions, range starts, and many boundary-search problems. Reading time: 10-12 min Tags: binary search, lower bound, sorted array SEO keywords: Search Insert Position, lower bound, binary search, LeetCode 35 Meta description: Lower-bound binary search for Search Insert Position, with boundary reasoning, pitfalls, engineering scenarios, and runnable implementations in Python, C, C++, Go, Rust, and JavaScript. Target Readers Learners who know basic binary search but still hesitate on boundary handling Engineers who insert or locate values in sorted tables Interview candidates who want one reusable lower-bound template Background / Motivation This problem looks simple because the output is a single index. The real lesson is deeper: ...

March 18, 2026 · 8 min · map[name:Jeanphilo]

LeetCode 744: Find Smallest Letter Greater Than Target Upper-Bound ACERS Guide

Subtitle / Summary This problem is a textbook upper-bound search with one extra twist: wrap-around. Once you can find the first character > target, the rest is just handling the “no answer inside the array” case by returning the first element. Reading time: 10-12 min Tags: binary search, upper bound, characters, wrap-around SEO keywords: Find Smallest Letter Greater Than Target, upper bound, LeetCode 744 Meta description: Use upper-bound binary search and wrap-around handling to solve LeetCode 744, with correctness reasoning, pitfalls, engineering scenarios, and runnable code in six languages. Target Readers Learners who already know lower bound and want to master upper bound Engineers who search the next greater value in a sorted cyclic list Interview candidates practicing boundary-style binary search Background / Motivation At first glance, this looks like a character problem. It is actually a boundary problem: ...

March 18, 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. Target Readers Hot100 learners who want a reliable “matrix simulation” template Intermediate engineers who often get boundary cases wrong Anyone working with grids (visualization, raster data, path generation) Background / Motivation Matrix problems are notorious for being “easy to code, hard to get 100% correct”. One extra loop or one missed boundary check can break single-row/single-column cases or cause duplicated output. ...

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

Hot100: Trapping Rain Water (Two Pointers O(n) ACERS Guide)

Subtitle / Summary Trapping Rain Water is the classic boundary-constraint problem. This ACERS guide explains the two-pointer method, key formulas, and runnable multi-language solutions. Reading time: 12–15 min Tags: Hot100, two pointers, array SEO keywords: Trapping Rain Water, two pointers, left right max, O(n), Hot100 Meta description: Two-pointer O(n) trapped water solution with engineering scenarios and multi-language code. Target Readers Hot100 learners building core templates Engineers handling capacity/volume constraints Anyone who wants a clean O(n) solution Background / Motivation Trapped water is a proxy for “capacity under boundary constraints.” It appears in cache headroom estimation, buffer overflow analysis, and terrain capacity modeling. The naive O(n^2) method is too slow; the two-pointer approach reduces it to O(n). ...

January 24, 2026 · 7 min · map[name:Jeanphilo]

Hot100: Maximum Subarray (Kadane O(n) ACERS Guide)

Subtitle / Summary Maximum Subarray is the classic 1D DP / greedy template. This ACERS guide explains Kadane’s idea, engineering use cases, and runnable multi-language solutions. Reading time: 10–12 min Tags: Hot100, dynamic programming, greedy SEO keywords: Maximum Subarray, Kadane, dynamic programming, O(n), Hot100 Meta description: Kadane O(n) maximum subarray sum with engineering scenarios and multi-language code. Target Readers Hot100 learners building stable templates Engineers analyzing peak segments in time series Anyone who wants a clean O(n) solution Background / Motivation Maximum subarray sum appears in P&L streaks, KPI lift windows, anomaly bursts, and throughput gains. The naive O(n^2) enumeration does not scale. Kadane’s algorithm solves it in one pass. ...

January 23, 2026 · 7 min · map[name:Jeanphilo]

LeetCode 1437: Check If All 1's Are at Least K Apart (ACERS Guide)

Subtitle / Summary A classic event-spacing validation model. This ACERS guide explains the one-pass logic, engineering use cases, and runnable multi-language solutions. Reading time: 10–12 min Tags: array, two pointers, event spacing SEO keywords: LeetCode 1437, event spacing, O(n) Meta description: One-pass validation for minimum spacing between 1s, with engineering use cases and multi-language code. Target Readers LeetCode learners building stable templates Engineers working on monitoring / risk control / behavior analytics Developers who need spacing or rate-limit validations Background / Motivation Many systems require events to be spaced apart: login failures, alarms, sensitive actions, API calls, etc. This problem maps directly to event spacing validation. A one-pass, O(1)-memory solution is ideal for real-time systems. ...

January 22, 2026 · 7 min · map[name:Jeanphilo]