Binary Search

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

Hot100: Reverse Linked List II Dummy Node + Head-Insertion ACERS Guide

Subtitle / Summary Reverse Linked List II is not about full-list reversal; it is about reversing a strict middle interval while preserving both outer connections. This ACERS guide explains the dummy-node anchor, head-insertion loop, and boundary-safe implementation. Reading time: 12-15 min Tags: Hot100, linked list, sublist reversal, dummy node SEO keywords: Reverse Linked List II, sublist reversal, dummy node, head insertion, LeetCode 92, Hot100 Meta description: In-place sublist reversal with dummy node + head insertion in O(n)/O(1), with correctness intuition, pitfalls, and runnable multi-language code. Target Readers Hot100 learners who already know 206 and want the interval version Developers who often fail at linked-list boundary handling (left = 1, right = n) Engineers building reusable pointer-rewiring templates Background / Motivation LeetCode 206 reverses the whole list. LeetCode 92 asks for a stricter operation: ...

February 10, 2026 · 10 min · map[name:Jeanphilo]

Hot100: Linked List Cycle Floyd Fast/Slow Pointer ACERS Guide

Subtitle / Summary Detecting a cycle in a linked list is a pointer chasing problem, not a value comparison problem. This ACERS guide explains why Floyd’s fast/slow pointers must meet if a cycle exists, how to avoid null-pointer bugs, and how the same pattern maps to engineering checks. Reading time: 10-12 min Tags: Hot100, linked list, fast slow pointers, Floyd SEO keywords: Linked List Cycle, Floyd, fast slow pointers, LeetCode 141, Hot100 Meta description: O(n)/O(1) cycle detection in singly linked lists using Floyd fast/slow pointers, with alternatives, common mistakes, and runnable multi-language code. Target Readers Hot100 learners and interview candidates Developers building reusable linked-list two-pointer templates Engineers who need to detect loops in chain-like structures Background / Motivation Cycle bugs are common in pointer-linked structures: ...

February 10, 2026 · 8 min · map[name:Jeanphilo]

Hot100: Palindrome Linked List Fast/Slow + Reverse Second Half O(1) Space ACERS Guide

Subtitle / Summary The core of palindrome validation is symmetric comparison, but a singly linked list cannot move backward. The most stable engineering template is: find middle -> reverse second half in-place -> compare -> reverse back to restore. Reading time: 10-14 min Tags: Hot100, linked list, fast slow pointers, in-place reverse SEO keywords: Palindrome Linked List, fast slow pointers, reverse second half, O(1) space, LeetCode 234 Meta description: O(n)/O(1) palindrome check for singly linked list with middle detection, second-half reversal, comparison, and full structure restoration. Target Readers Hot100 learners who want to master the “middle + reverse” linked-list combo Developers who frequently solve palindrome/symmetry interview questions Engineers who care about low extra memory and non-destructive checks Background / Motivation For arrays, palindrome check is easy with two pointers from both ends. For singly linked lists, you can only move forward via next, so symmetric comparison is not direct. ...

February 9, 2026 · 10 min · map[name:Jeanphilo]

Hot100: Reverse Linked List Three-Pointer Iterative/Recursive ACERS Guide

Subtitle / Summary Reverse Linked List is the first serious pointer-rewiring exercise in Hot100. It looks simple, but most bugs come from broken links and wrong operation order. This ACERS guide explains the three-pointer iterative template thoroughly and compares it with recursion. Reading time: 10-12 min Tags: Hot100, linked list, pointer, iteration SEO keywords: Hot100, Reverse Linked List, three pointers, iterative, recursive, LeetCode 206 Meta description: Three-pointer iterative reversal in O(n)/O(1), with recursive contrast, common pitfalls, engineering mapping, and runnable multi-language implementations. Target Readers Hot100 learners and interview candidates Developers who often hit null-pointer or broken-chain bugs in list problems Engineers who want stable pointer manipulation patterns in C/C++/Rust/Go Background / Motivation In production code, “reverse linked list” may not appear as a LeetCode function, but the skill is highly transferable: ...

February 9, 2026 · 9 min · map[name:Jeanphilo]

Hot100: Subarray Sum Equals K Prefix Sum + Hash Map ACERS Guide

Subtitle / Summary This is Hot100 article #1 for the series: Subarray Sum Equals K. We reduce the naive O(n^2) approach to O(n) with prefix sum plus a frequency hash map, then map the same pattern to real engineering scenarios. Reading time: 12-15 min Tags: Hot100, prefix sum, hash map SEO keywords: Subarray Sum Equals K, prefix sum, hash map, O(n), Hot100 Meta description: O(n) counting of subarrays with sum k using prefix sum + hash map, with complexity analysis and runnable multi-language code. Target Readers Hot100 learners who want stable reusable templates Intermediate engineers who want to transfer counting patterns to real data pipelines Interview prep readers who want to master prefix sum + hash map Background / Motivation “Count subarrays whose sum equals k” is one of the most classic counting problems. It appears in log analytics, risk threshold hits, and transaction sequence statistics. The two-loop brute force method is straightforward, but slows down quickly as input grows. So we need an O(n) method that scales. ...

February 9, 2026 · 9 min · map[name:Jeanphilo]

Hot100: Intersection of Two Linked Lists Two-Pointer Switch-Head O(1) Space ACERS Guide

Subtitle / Summary The key is not comparing values, but comparing node identity (same object / same address). This ACERS guide explains the naive hash approach, the length-alignment approach, and the most practical switch-head two-pointer template, with runnable multi-language implementations under the no-modification and no-cycle constraints. Reading time: 10-14 min Tags: Hot100, linked list, two pointers SEO keywords: Intersection of Two Linked Lists, switch heads, O(1) space, LeetCode 160 Meta description: Two pointers walk A then B and B then A, guaranteeing meeting at the intersection or both reaching null within m+n steps, with O(m+n) time and O(1) space. Target Readers Hot100 learners who want a reusable linked-list two-pointer template Developers who often confuse “same value” with “same node” Engineers working with shared tail structures in chain-like data Background / Motivation This problem looks simple, but it forces you to separate three concepts: ...

February 9, 2026 · 12 min · map[name:Jeanphilo]

Path Sum III: Prefix Sum + Hash Map Counting Downward Paths (LeetCode 437) ACERS Guide

Subtitle / Summary The constraint “the path can start anywhere, but must go downward” makes root-to-leaf DP insufficient. This ACERS guide explains prefix sums on trees: convert any downward path into a difference of two prefix sums, maintain a frequency hash map during one DFS, and finish in O(n). Reading time: 12–15 min Tags: binary tree, prefix sum, DFS, hash map SEO keywords: Path Sum III, tree prefix sum, prefix-sum hash, LeetCode 437 Meta description: Count downward paths whose sum equals targetSum in O(n) via prefix sum + hash map, with derivation, tradeoffs, and multi-language implementations. Target Readers LeetCode learners who want a reusable “tree + hash map” template People who tend to write O(n²) when the path does not have to start at the root Engineers working with hierarchical data (call traces, org trees) who need “downward segment” statistics Background / Motivation Many “tree path” problems hide a trap: you naturally assume paths start at the root, or end at leaves — but this problem allows the path to start and end at any nodes, as long as the direction is downward (parent → child). ...

February 4, 2026 · 15 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]