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]

LeetCode 138: Copy List with Random Pointer — A Complete Deep-Copy Breakdown

Subtitle / Abstract The real challenge in this problem is not traversing the list, but correctly cloning the cross-node reference relationships created by random pointers. This article moves from naive intuition to a hash-mapping solution, and explains why it is stable, maintainable, and practical in real engineering. Estimated reading time: 12–16 minutes Tags: Linked List, Deep Copy, Hash Table, Random Pointer SEO keywords: LeetCode 138, Copy List with Random Pointer, random list copy, deep copy, hash mapping Meta description: Perform deep copy of a random-pointer linked list via two passes plus a mapping table, with correctness, complexity, engineering practice, and six-language implementations. A — Algorithm (Problem and Algorithm) Problem Restatement Given a linked list of length n, each node has: ...

February 11, 2026 · 15 min · map[name:Jeanphilo]

LeetCode 1512: Number of Good Pairs (Hash Counting ACERS Guide)

Subtitle / Abstract A basic counting problem: use frequency + combinations to drop O(n^2) to O(n). Includes engineering use cases and portable implementations. Reading time: 8-10 minutes Tags: hash-table, counting, array SEO keywords: Good Pairs, hash map, frequency Meta description: Hash counting solution for Good Pairs with complexity and code. Target readers Beginners learning hash tables and counting Engineers who want to map interview patterns to real stats tasks Interview prep for basic counting models Background / Motivation Counting equal pairs is a classic problem. A double loop is O(n^2). With frequency counting, you can solve it in linear time and scale to large data. ...

December 30, 2025 · 5 min · map[name:Jeanphilo]