Hot100: LRU Cache Hash Table + Doubly Linked List O(1) ACERS Guide

Subtitle / Summary LeetCode 146 is not a memorize-the-template problem. It is the core cache-design exercise: how to support fast lookup and fast recency updates at the same time. Reading time: 14-18 min Tags: Hot100, LRU, hash table, doubly linked list SEO keywords: LRU Cache, hash table + doubly linked list, O(1) get put, LeetCode 146, Hot100 Meta description: A derivation-first ACERS guide to LRU Cache using a hash table plus doubly linked list, with engineering scenarios, pitfalls, and runnable multi-language code. A - Algorithm (Problem and Algorithm) Problem Restatement Design a data structure LRUCache with: ...

April 20, 2026 · 19 min · map[name:Jeanphilo]

Hot100: Remove Nth Node From End of List One-Pass Two-Pointer ACERS Guide

Subtitle / Summary The hard part of LeetCode 19 is not deleting a node. It is locating the predecessor of the n-th node from the end in a singly linked list without walking backward. Reading time: 12-15 min Tags: Hot100, linked list, two pointers, dummy node SEO keywords: Remove Nth Node From End of List, one-pass two pointers, dummy node, LeetCode 19, Hot100 Meta description: A derivation-first ACERS explanation of LeetCode 19 with fixed-gap two pointers, dummy node boundary handling, engineering mapping, and runnable multi-language implementations. A - Algorithm (Problem and Algorithm) Problem Restatement Given the head of a linked list, remove the n-th node from the end of the list and return the head of the modified list. ...

April 20, 2026 · 14 min · map[name:Jeanphilo]

Hot100: Diameter of Binary Tree (Tree DP / Height Return ACERS Guide)

Subtitle / Summary The most common confusion in LeetCode 543 is deciding what the recursive function should return. It should return height, not diameter. The diameter is updated globally at each node using leftHeight + rightHeight. Once that separation is clear, the problem becomes a clean introduction to tree DP. Reading time: 10-13 min Tags: Hot100, binary tree, tree DP, DFS, postorder SEO keywords: Diameter of Binary Tree, tree DP, height return, DFS, LeetCode 543 Meta description: Learn LeetCode 543 from the postorder height-return pattern, with step-by-step derivation, engineering analogies, and runnable multi-language solutions. A — Algorithm Problem Restatement Given the root root of a binary tree, return the diameter of the tree. ...

April 19, 2026 · 12 min · map[name:Jeanphilo]

Hot100: Lowest Common Ancestor of a Binary Tree (Postorder Return Semantics ACERS Guide)

Subtitle / Summary The real difficulty of LeetCode 236 is not memorizing an LCA template. It is defining what each recursive call should return. Once that return value becomes stable, the whole problem collapses into a short and very clean postorder recursion. Reading time: 11-14 min Tags: Hot100, binary tree, LCA, DFS, postorder SEO keywords: Lowest Common Ancestor of a Binary Tree, LCA, postorder, DFS, LeetCode 236 Meta description: Learn LeetCode 236 from the recursive return-value semantics, with step-by-step derivation, engineering mappings, and runnable multi-language implementations. A — Algorithm Problem Restatement Given a binary tree, find the lowest common ancestor (LCA) of two given nodes p and q. ...

April 19, 2026 · 14 min · map[name:Jeanphilo]

Hot100: Validate Binary Search Tree (Range Constraints / Inorder ACERS Guide)

Subtitle / Summary The hardest part of LeetCode 98 is usually not recursion itself. It is realizing that checking a node against only its parent is not enough. A valid BST is constrained by all of its ancestors, so the stable solution is to pass a valid range downward. This guide explains that idea from scratch, then connects it to the equivalent inorder-sorted view. Reading time: 11-13 min Tags: Hot100, binary tree, BST, DFS, inorder traversal SEO keywords: Validate Binary Search Tree, BST, range constraints, inorder traversal, DFS, LeetCode 98 Meta description: Learn LeetCode 98 from the core invariant low < val < high, with step-by-step derivation, engineering mappings, and runnable multi-language implementations. A — Algorithm Problem Restatement Given the root root of a binary tree, determine whether it is a valid binary search tree (BST). ...

April 19, 2026 · 12 min · map[name:Jeanphilo]

Hot100: N-Queens Incremental Build Tutorial

51. N-Queens is best learned by watching the code grow one small step at a time. This tutorial keeps only the teaching path: tiny example, first DFS skeleton, first correct version, column-only optimization, then full diagonal-state optimization. Problem The n-queens puzzle asks us to place n queens on an n x n chessboard so that no two queens attack each other. Given an integer n, return all distinct solutions. Each solution is represented as a list of strings where: ...

April 19, 2026 · 8 min · map[name:Jeanphilo]

Hot100: Palindrome Partitioning (Backtracking / Palindrome Table ACERS Guide)

Subtitle / Summary 131. Palindrome Partitioning is not hard because of recursion alone. The real challenge is separating two concerns clearly: where the next cut starts, and whether the current substring is a valid palindrome. Reading time: 15-18 min Tags: Hot100, backtracking, string, palindrome, DP SEO keywords: Palindrome Partitioning, backtracking, palindrome DP, string partition, LeetCode 131 Meta description: Learn LeetCode 131 by building the solution from scratch, using suffix-based DFS plus a precomputed palindrome table. A — Algorithm Problem Restatement Given a string s, partition it so that every substring in the partition is a palindrome. Return all possible palindrome partitionings of s. ...

April 19, 2026 · 15 min · map[name:Jeanphilo]

Hot100: Combination Sum (Backtracking / Pruning ACERS Guide)

Subtitle / Summary Combination Sum is the first Hot100 backtracking problem that really mixes three ideas at once: combination-style search, a running target, and safe pruning after sorting. The point is not to jump straight to the template, but to build it step by step from the problem itself. Reading time: 14-16 min Tags: Hot100, backtracking, combination sum, pruning SEO keywords: Combination Sum, backtracking, pruning, remain, DFS Meta description: Learn LeetCode 39 by building the solution from scratch, using path, remain, repeated candidate reuse, and sorted pruning. A — Algorithm Problem Restatement Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. ...

April 8, 2026 · 13 min · map[name:Jeanphilo]

Hot100: Permutations (used[] Backtracking ACERS Guide)

Subtitle / Summary If Subsets teaches the skeleton of combination-style backtracking, Permutations teaches the core of state-based backtracking: at each position, choose one unused element, continue until the path length reaches n, and only then collect the answer. Reading time: 10-12 min Tags: Hot100, backtracking, permutations, DFS SEO keywords: Permutations, backtracking, used array, DFS, LeetCode 46 Meta description: Learn the stable permutation backtracking template for LeetCode 46, with state recovery, engineering analogies, and runnable multi-language solutions. A — Algorithm Problem Restatement Given an array nums of distinct integers, return all possible permutations. The answer may be returned in any order. ...

April 3, 2026 · 10 min · map[name:Jeanphilo]

Hot100: Binary Tree Level Order Traversal (BFS / DFS ACERS Guide)

Subtitle / Summary Level order traversal is the entry point of the binary-tree BFS template. The real key is not merely “use a queue”, but “separate one level from the next correctly”. This ACERS guide explains the level-size pattern, the DFS depth-bucket alternative, and engineering situations where grouped-by-depth traversal is useful. Reading time: 10-12 min Tags: Hot100, binary tree, BFS, DFS, queue, level order traversal SEO keywords: Hot100, Binary Tree Level Order Traversal, BFS, queue, level order traversal, LeetCode 102 Meta description: A systematic guide to LeetCode 102 from level-by-level BFS to DFS depth buckets, with engineering scenarios and runnable multi-language implementations. Target Readers Hot100 learners who want to make the BFS tree template stable Developers who can traverse a tree but still mix up current-level and next-level boundaries Engineers who need to group tree-shaped data by depth for display or execution Background / Motivation LeetCode 102 is one of the most standard tree-BFS starter problems. ...

March 16, 2026 · 12 min · map[name:Jeanphilo]