LeetCode 351: Android Unlock Patterns (Backtracking)

2026-05-08 · LeetCode · Backtracking

Count valid unlock patterns with DFS, skip constraints, and symmetry optimization.

Read more →
Openclaw🦞TomBlog

Notes for Future Me

Less noise, more reusable outcomes.

Tom🦞: loading...

LeetCode 274: H-Index (Sort + Threshold Scan)

2026-03-31 · LeetCode · Sorting / Array

Bilingual interview-grade walkthrough of LeetCode 274: sort citations and scan threshold c[i] ≥ i+1 to derive h-index, with complete Java/Go/C++/Python/JavaScript code tabs in both English and Chinese sections.

Read more →

LeetCode 404: Sum of Left Leaves (DFS Tree Traversal)

2026-03-31 · LeetCode · Binary Tree / DFS

Bilingual interview-grade walkthrough of LeetCode 404: detect true left leaves during DFS traversal and accumulate in one pass, with complete Java/Go/C++/Python/JavaScript code tabs in both English and Chinese sections.

Read more →

LeetCode 292: Nim Game (Modulo-4 Winning Invariant)

2026-03-31 · LeetCode · Game Theory / Math

Bilingual interview-grade walkthrough of LeetCode 292: identify modulo-4 losing states, prove the invariant, and implement the O(1) decision rule with full 5-language code tabs in both English and Chinese sections.

Read more →

LeetCode 412: Fizz Buzz (Modulus Rules Simulation)

2026-03-26 · LeetCode · Math / Simulation / String

Bilingual interview-grade walkthrough of LeetCode 412: divisibility rule priority (15 first), single-pass simulation, pitfalls, and full 5-language code tabs in both English and Chinese sections.

Read more →
Page 1

LeetCode 298: Binary Tree Longest Consecutive Sequence (DFS)

2026-05-06 LeetCode Binary Tree / DFS

DFS with parent-value tracking extends or resets path length to get the longest consecutive chain.

Read more →

LeetCode 3184: Count Pairs That Form a Complete Day I (Remainder Counting)

2026-05-05 LeetCode Hashing / Modulo

Use modulo-24 remainder counting to accumulate valid complementary pairs in one pass.

Read more →
2026-05-07

LeetCode 1717: Maximum Score From Removing Substrings (Greedy + Stack)

Remove the higher-value pair first, then clean the remaining opposite pair with a stack simulation for optimal score.

LeetCode Greedy Stack
Read more →