<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Jeanphilo Blog</title><link>https://jeanphilogong.github.io/jeanblog/</link><description>Recent content on Jeanphilo Blog</description><generator>Hugo -- 0.168.0</generator><language>en-us</language><lastBuildDate>Sat, 10 Oct 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://jeanphilogong.github.io/jeanblog/index.xml" rel="self" type="application/rss+xml"/><item><title>LeetCode 1282: Group the People, from Capacity Buckets to Emitting Full Groups</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/1282-group-the-people-given-the-group-size-they-belong-to/</link><pubDate>Sat, 10 Oct 2026 10:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/1282-group-the-people-given-the-group-size-they-belong-to/</guid><description>Distinguish person IDs from group sizes, collect and split capacity buckets, then build a one-pass Python solution that emits full groups without mutating saved results.</description></item><item><title>LeetCode 49: Group Anagrams, from Scanning Groups to Building a Grouping Key</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/49-group-anagrams/</link><pubDate>Sat, 10 Oct 2026 10:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/49-group-anagrams/</guid><description>Build a Python solution one step at a time: compare two anagrams, scan group representatives, then derive sorted-string and character-count keys to understand why hash-table grouping works.</description></item><item><title>LeetCode 609: Find Duplicate File in System, from Parsing Records to Grouping by Content</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/609-find-duplicate-file-in-system/</link><pubDate>Sat, 10 Oct 2026 10:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/609-find-duplicate-file-in-system/</guid><description>Solve LeetCode 609 step by step: parse directory descriptions, build a correct pairwise baseline, group by content, and account for path construction and real-filesystem limitations.</description></item><item><title>LeetCode 152: Maximum Product Subarray, Deriving Two DP States from a Negative Counterexample</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/152-maximum-product-subarray/</link><pubDate>Thu, 08 Oct 2026 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/152-maximum-product-subarray/</guid><description>Start by enumerating nonempty contiguous ranges, then use a negative counterexample to derive maximum and minimum product states and a constant-space Python solution.</description></item><item><title>LeetCode 279: Perfect Squares, Deriving Dynamic Programming from Remaining Sums</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/279-perfect-squares/</link><pubDate>Thu, 08 Oct 2026 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/279-perfect-squares/</guid><description>Start with a failed largest-square choice, then build recursion, memoization, and iterative dynamic programming to minimize the number of perfect squares.</description></item><item><title>LeetCode 139: Word Break, Starting from Prefix Reachability</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/139-word-break/</link><pubDate>Tue, 22 Sep 2026 12:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/139-word-break/</guid><description>&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;h3 id="input-and-output"&gt;Input and Output&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Input: a string &lt;code&gt;s&lt;/code&gt; and a list of strings &lt;code&gt;wordDict&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Every element in &lt;code&gt;wordDict&lt;/code&gt; is an available word, and the same word may be reused&lt;/li&gt;
&lt;li&gt;Output: return &lt;code&gt;True&lt;/code&gt; if &lt;code&gt;s&lt;/code&gt; can be split into one or more dictionary words; otherwise, return &lt;code&gt;False&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The split must cover the entire string without skipping or reordering characters&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="examples"&gt;Examples&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: s = &amp;#34;leetcode&amp;#34;, wordDict = [&amp;#34;leet&amp;#34;, &amp;#34;code&amp;#34;]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: True
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: &amp;#34;leetcode&amp;#34; can be split into &amp;#34;leet&amp;#34; + &amp;#34;code&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: s = &amp;#34;applepenapple&amp;#34;, wordDict = [&amp;#34;apple&amp;#34;, &amp;#34;pen&amp;#34;]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: True
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: &amp;#34;apple&amp;#34; + &amp;#34;pen&amp;#34; + &amp;#34;apple&amp;#34;; the same word may be reused
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: s = &amp;#34;catsandog&amp;#34;, wordDict = [&amp;#34;cats&amp;#34;, &amp;#34;dog&amp;#34;, &amp;#34;sand&amp;#34;, &amp;#34;and&amp;#34;, &amp;#34;cat&amp;#34;]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: False
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: some prefixes can be formed, but the split cannot cover the entire string
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="constraints"&gt;Constraints&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;1 &amp;lt;= s.length &amp;lt;= 300&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1 &amp;lt;= wordDict.length &amp;lt;= 1000&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;1 &amp;lt;= wordDict[i].length &amp;lt;= 20&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s&lt;/code&gt; and &lt;code&gt;wordDict[i]&lt;/code&gt; contain only lowercase English letters&lt;/li&gt;
&lt;li&gt;All strings in &lt;code&gt;wordDict&lt;/code&gt; are unique&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="step-1-make-the-completed-prefix-visible"&gt;Step 1: Make the Completed Prefix Visible&lt;/h2&gt;
&lt;p&gt;Start with one concrete question. For &lt;code&gt;s = &amp;quot;leetcode&amp;quot;&lt;/code&gt;, before deciding whether the whole string can be split, can we record how much of it has already been completed?&lt;/p&gt;</description></item><item><title>LeetCode 213: House Robber II, Splitting the Circle into Two Linear Problems</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/213-house-robber-ii/</link><pubDate>Tue, 22 Sep 2026 10:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/213-house-robber-ii/</guid><description>&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;h3 id="input-and-output"&gt;Input and Output&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Input: an integer array &lt;code&gt;nums&lt;/code&gt;, where &lt;code&gt;nums[i]&lt;/code&gt; is the money in the &lt;code&gt;i&lt;/code&gt;-th house.&lt;/li&gt;
&lt;li&gt;The houses form a circle. Adjacent houses cannot both be robbed, so houses &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;n - 1&lt;/code&gt; cannot both be robbed either.&lt;/li&gt;
&lt;li&gt;Output: the maximum amount of money that can be robbed without triggering the alarm.&lt;/li&gt;
&lt;li&gt;Constraints: &lt;code&gt;1 &amp;lt;= nums.length &amp;lt;= 100&lt;/code&gt;, &lt;code&gt;0 &amp;lt;= nums[i] &amp;lt;= 1000&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="examples"&gt;Examples&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: nums = [2,3,2]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: 3
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: Houses 0 and 2 are adjacent around the circle, so they cannot both be robbed; rob the house containing 3.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: nums = [1,2,3,1]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: 4
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: We can rob indices 0 and 2, or indices 1 and 3.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: nums = [1,2,3]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: 3
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This tutorial uses Python only and starts with the smallest first-last conflict.&lt;/p&gt;</description></item><item><title>LeetCode 322: Coin Change, Deriving Unbounded Knapsack DP from Smaller Amounts</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/322-coin-change/</link><pubDate>Tue, 22 Sep 2026 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/322-coin-change/</guid><description>Start from a greedy failure and smaller-amount subproblems, then build an unbounded knapsack DP that finds the minimum number of coins.</description></item><item><title>LeetCode 300: Longest Increasing Subsequence, Deriving Sequence DP from Ending at i</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/300-longest-increasing-subsequence/</link><pubDate>Tue, 22 Sep 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/300-longest-increasing-subsequence/</guid><description>&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;h3 id="input-and-output"&gt;Input and Output&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Input: an integer array &lt;code&gt;nums&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Output: return the length of the longest strictly increasing subsequence in &lt;code&gt;nums&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;A subsequence preserves the relative order of the original array, but it does not need to be contiguous, so elements may be skipped&lt;/li&gt;
&lt;li&gt;If the selected indices are &lt;code&gt;i_1 &amp;lt; i_2 &amp;lt; ... &amp;lt; i_k&lt;/code&gt;, they must also satisfy &lt;code&gt;nums[i_1] &amp;lt; nums[i_2] &amp;lt; ... &amp;lt; nums[i_k]&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The subsequence is non-empty, so at least one element must be selected&lt;/li&gt;
&lt;li&gt;Constraints: &lt;code&gt;1 &amp;lt;= nums.length &amp;lt;= 2500&lt;/code&gt;, &lt;code&gt;-10^4 &amp;lt;= nums[i] &amp;lt;= 10^4&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="examples"&gt;Examples&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: nums = [10,9,2,5,3,7,101,18]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: 4
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: [2,5,7,101] is a strictly increasing subsequence of length 4; its elements do not need to be contiguous in the original array.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: nums = [0,1,0,3,2,3]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: 4
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: [0,1,2,3] has length 4; [0,1,3] is also valid, but shorter.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This article uses Python only. We start with the local question &amp;ldquo;how long can a subsequence ending at each position be?&amp;rdquo; and gradually turn it into a runnable solution.&lt;/p&gt;</description></item><item><title>LeetCode 416: Partition Equal Subset Sum, from the Half-Sum Target to Backward 0/1 Knapsack</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/416-partition-equal-subset-sum/</link><pubDate>Tue, 22 Sep 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/416-partition-equal-subset-sum/</guid><description>Start from the constraints of Partition Equal Subset Sum, build the 0/1 knapsack state step by step, and see why one-dimensional compression requires backward iteration.</description></item><item><title>LeetCode 155: Min Stack, Keeping the Minimum in Sync With Stack State</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/155-min-stack/</link><pubDate>Fri, 21 Aug 2026 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/155-min-stack/</guid><description>Start from restoring the previous minimum after pop, build a correct scan baseline, and derive an O(1) Min Stack with synchronized prefix minima.</description></item><item><title>LeetCode 20: Valid Parentheses, Why Equal Counts Are Not Enough</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/20-valid-parentheses/</link><pubDate>Fri, 21 Aug 2026 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/20-valid-parentheses/</guid><description>Start from the counterexample ([)], separate equal bracket counts from correct types and closing order, and derive an O(n) stack solution.</description></item><item><title>LeetCode 394: Decode String by Saving and Restoring Nested Context</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/394-decode-string/</link><pubDate>Fri, 21 Aug 2026 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/394-decode-string/</guid><description>Start from the context lost by nested encoding, build a correct recursive parser, and make its saved frames explicit with a stack.</description></item><item><title>LeetCode 74: Search a 2D Matrix</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/74-search-a-2d-matrix/</link><pubDate>Thu, 13 Aug 2026 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/74-search-a-2d-matrix/</guid><description>&lt;p&gt;You are given an &lt;code&gt;m x n&lt;/code&gt; integer matrix &lt;code&gt;matrix&lt;/code&gt; and an integer &lt;code&gt;target&lt;/code&gt;. Return &lt;code&gt;True&lt;/code&gt; if &lt;code&gt;target&lt;/code&gt; is in the matrix; otherwise, return &lt;code&gt;False&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The matrix satisfies two conditions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Every row is sorted in non-decreasing order.&lt;/li&gt;
&lt;li&gt;The first integer of each row is strictly greater than the last integer of the previous row.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The required time complexity is &lt;code&gt;O(log(m * n))&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For example, consider this matrix:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;1 3 5 7
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;10 11 16 20
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;23 30 34 60
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;When &lt;code&gt;target = 3&lt;/code&gt;, return &lt;code&gt;True&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;When &lt;code&gt;target = 13&lt;/code&gt;, return &lt;code&gt;False&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The constraints are:&lt;/p&gt;</description></item><item><title>LeetCode 153: Find Minimum in Rotated Sorted Array</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/153-find-minimum-in-rotated-sorted-array/</link><pubDate>Tue, 28 Jul 2026 16:13:57 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/153-find-minimum-in-rotated-sorted-array/</guid><description>Start from a linear scan, derive a closed minimum-containing interval, and return the rotated array&amp;#39;s minimum in O(log n) time and O(1) auxiliary space.</description></item><item><title>LeetCode 33: Search in Rotated Sorted Array</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/33-search-in-rotated-sorted-array/</link><pubDate>Tue, 28 Jul 2026 15:40:34 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/33-search-in-rotated-sorted-array/</guid><description>Derive sorted-half recognition and target-range tests from a linear baseline to search a rotated array in O(log n) time and O(1) auxiliary space.</description></item><item><title>LeetCode 503: Where Does the Right Side End in a Circular Array?</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/503-next-greater-element-ii/</link><pubDate>Mon, 20 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/503-next-greater-element-ii/</guid><description>Start from the exact circular next-greater query, build a verifiable scan, then derive a linear monotonic-stack solution that pushes each original index once.</description></item><item><title>LeetCode 84: Which Bar Limits a Contiguous Rectangle?</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/84-largest-rectangle-in-histogram/</link><pubDate>Mon, 20 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/84-largest-rectangle-in-histogram/</guid><description>Start from the shortest bar in a contiguous interval, build an interval baseline, then derive a linear monotonic-stack solution that settles maximal widths.</description></item><item><title>LeetCode 136: Single Number Without Growing Extra Storage</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/136-single-number/</link><pubDate>Wed, 15 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/136-single-number/</guid><description>Start from a set-based pairing baseline, derive XOR cancellation, and solve LeetCode 136 in O(n) time with O(1) extra space.</description></item><item><title>LeetCode 191: Number of 1 Bits and How to Skip Irrelevant Zeros</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/191-number-of-1-bits/</link><pubDate>Wed, 15 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/191-number-of-1-bits/</guid><description>Start from a right-shift baseline, derive how n &amp;amp; (n - 1) clears one lowest set bit, and prove LeetCode 191 with a loop invariant.</description></item><item><title>LeetCode 338: Counting Bits by Reusing Smaller Results</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/338-counting-bits/</link><pubDate>Wed, 15 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/338-counting-bits/</guid><description>Start by counting every value in 0..n independently, then derive answer[i] = answer[i &amp;amp; (i - 1)] + 1 for an O(n) solution.</description></item><item><title>LeetCode 739: Daily Temperatures and the First Warmer Day to the Right</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/739-daily-temperatures/</link><pubDate>Wed, 15 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/739-daily-temperatures/</guid><description>Start from an O(n^2) right-scan baseline, derive a monotonic stack of unresolved indices, and solve LeetCode 739 in O(n) time.</description></item><item><title>LeetCode 45: Jump Game II From Reachability to Minimum Jumps</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/greedy/45-jump-game-ii/</link><pubDate>Wed, 08 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/greedy/45-jump-game-ii/</guid><description>Solve LeetCode 45 Jump Game II in Python by upgrading the farthest reach idea from LeetCode 55 into a minimum-jump layer boundary with current_end and farthest.</description></item><item><title>LeetCode 435: Non-overlapping Intervals From Minimum Removals to Maximum Kept</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/greedy/435-non-overlapping-intervals/</link><pubDate>Mon, 06 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/greedy/435-non-overlapping-intervals/</guid><description>Solve LeetCode 435 in Python by turning minimum removals into maximum kept non-overlapping intervals, then deriving the earliest-ending interval greedy scan.</description></item><item><title>LeetCode 452: Minimum Number of Arrows From Shared Intersections to Interval Greedy</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/greedy/452-minimum-number-of-arrows-to-burst-balloons/</link><pubDate>Mon, 06 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/greedy/452-minimum-number-of-arrows-to-burst-balloons/</guid><description>Solve LeetCode 452 in Python by deriving arrow coverage from shared interval intersections, then compressing the baseline into an earliest-ending arrow_pos greedy scan.</description></item><item><title>LeetCode 121: Best Time to Buy and Sell Stock With Greedy</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/greedy/121-best-time-to-buy-and-sell-stock/</link><pubDate>Fri, 03 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/greedy/121-best-time-to-buy-and-sell-stock/</guid><description>Solve LeetCode 121 in Python by deriving the one-transaction greedy idea from the buy-before-sell constraint, an O(n^2) baseline, and the historical minimum price.</description></item><item><title>LeetCode 55: Jump Game With Farthest Reach Greedy</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/greedy/55-jump-game/</link><pubDate>Fri, 03 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/greedy/55-jump-game/</guid><description>Solve LeetCode 55 Jump Game in Python by deriving reachability from a zero barrier, a reachable-array baseline, and the farthest reachable range greedy.</description></item><item><title>LeetCode 200: Number of Islands With Union-Find</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/union-find/200-number-of-islands/</link><pubDate>Thu, 02 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/union-find/200-number-of-islands/</guid><description>Solve LeetCode 200 Number of Islands in Python by deriving land-only count, 2D-to-1D ids, Union-Find merges, and exactly when count decreases.</description></item><item><title>LeetCode 684: Redundant Connection With Union-Find</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/union-find/684-redundant-connection/</link><pubDate>Thu, 02 Jul 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/union-find/684-redundant-connection/</guid><description>Solve LeetCode 684 Redundant Connection in Python by deriving the already-connected edge pressure, 1-indexed parent array, bool-returning union, and ordered edge scan.</description></item><item><title>Union-Find Template: Derive find / union / count</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/union-find/union-find-template/</link><pubDate>Tue, 30 Jun 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/union-find/union-find-template/</guid><description>Derive the Python Union-Find template from a small set-merging task: parent, find, union, count, connected, and path compression.</description></item><item><title>LeetCode 208: Implement Trie (Prefix Tree) in Python</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/trie/208-implement-trie-prefix-tree/</link><pubDate>Thu, 25 Jun 2026 13:58:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/trie/208-implement-trie-prefix-tree/</guid><description>Solve LeetCode 208 in Python by deriving Trie node fields, children traversal, is_end, insert, search, startsWith, and the exact interface LeetCode expects.</description></item><item><title>Trie Template Guide: Node Fields, Child Traversal, and Loop Invariants</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/trie/trie-template/</link><pubDate>Thu, 25 Jun 2026 13:58:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/trie/trie-template/</guid><description>Build a Python Trie template from first principles: derive children, is_end, insert/search traversal, prefix lookup, and the loop invariants behind each method.</description></item><item><title>LeetCode 547: Number of Provinces, Turn an Adjacency Matrix into Connected Components</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/547-number-of-provinces/</link><pubDate>Fri, 29 May 2026 00:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/547-number-of-provinces/</guid><description>Turn LeetCode 547 Number of Provinces from direct connections in an adjacency matrix into connected component counting, then derive DFS, BFS, and Union Find solutions step by step.</description></item><item><title>LeetCode 198: House Robber, Deriving 1D DP from Rob or Skip</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/198-house-robber/</link><pubDate>Sun, 03 May 2026 14:33:39 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/198-house-robber/</guid><description>&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;h3 id="input-and-output"&gt;Input and Output&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Input: an integer array &lt;code&gt;nums&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nums[i]&lt;/code&gt; is the money in the &lt;code&gt;i&lt;/code&gt;-th house&lt;/li&gt;
&lt;li&gt;Adjacent houses cannot both be robbed&lt;/li&gt;
&lt;li&gt;Output: return the maximum amount of money that can be robbed&lt;/li&gt;
&lt;li&gt;Constraints: &lt;code&gt;1 &amp;lt;= nums.length &amp;lt;= 100&lt;/code&gt;, &lt;code&gt;0 &amp;lt;= nums[i] &amp;lt;= 400&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="examples"&gt;Examples&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: nums = [1,2,3,1]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: 4
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: rob indices 0 and 2, for 1 + 3 = 4
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: nums = [2,7,9,3,1]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: 12
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: rob indices 0, 2, and 4, for 2 + 9 + 1 = 12
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This article uses Python only and derives 1D DP from the conflict between two choices.&lt;/p&gt;</description></item><item><title>LeetCode 70: Climbing Stairs, Deriving 1D DP from dp[i]</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/70-climbing-stairs/</link><pubDate>Sun, 03 May 2026 14:33:39 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/70-climbing-stairs/</guid><description>&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;h3 id="input-and-output"&gt;Input and Output&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Input: an integer &lt;code&gt;n&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Meaning: climb to the top of the &lt;code&gt;n&lt;/code&gt;-step staircase&lt;/li&gt;
&lt;li&gt;Each move can climb &lt;code&gt;1&lt;/code&gt; or &lt;code&gt;2&lt;/code&gt; steps&lt;/li&gt;
&lt;li&gt;Output: return the number of distinct ways to reach the top&lt;/li&gt;
&lt;li&gt;Constraints: &lt;code&gt;1 &amp;lt;= n &amp;lt;= 45&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="examples"&gt;Examples&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: n = 2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: 2
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: 1+1, 2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: n = 3
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: 3
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: 1+1+1, 1+2, 2+1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This article uses Python only and derives the final solution step by step from the meaning of &lt;code&gt;dp[i]&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>LeetCode 746: Min Cost Climbing Stairs, Deriving DP from the Top Position</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/746-min-cost-climbing-stairs/</link><pubDate>Sun, 03 May 2026 14:33:39 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/746-min-cost-climbing-stairs/</guid><description>&lt;h2 id="problem"&gt;Problem&lt;/h2&gt;
&lt;h3 id="input-and-output"&gt;Input and Output&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Input: an integer array &lt;code&gt;cost&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cost[i]&lt;/code&gt; is the cost of stepping on stair &lt;code&gt;i&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Each move can climb &lt;code&gt;1&lt;/code&gt; or &lt;code&gt;2&lt;/code&gt; steps&lt;/li&gt;
&lt;li&gt;You may start from index &lt;code&gt;0&lt;/code&gt; or index &lt;code&gt;1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Output: return the minimum cost to reach the top&lt;/li&gt;
&lt;li&gt;Constraints: &lt;code&gt;2 &amp;lt;= cost.length &amp;lt;= 1000&lt;/code&gt;, &lt;code&gt;0 &amp;lt;= cost[i] &amp;lt;= 999&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="examples"&gt;Examples&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: cost = [10,15,20]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: 15
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Explanation: start from index 1, pay 15, then reach the top directly
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: cost = [1,100,1,1,1,100,1,1,100,1]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: 6
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="start-from-the-top-position-of-101520"&gt;Start from the Top Position of [10,15,20]&lt;/h2&gt;
&lt;p&gt;Look at the small example:&lt;/p&gt;</description></item><item><title>LeetCode 78: Subsets, Derive the startIndex Backtracking Template</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/78-subsets/</link><pubDate>Sun, 03 May 2026 14:25:07 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/78-subsets/</guid><description>&lt;h2 id="problem-requirement"&gt;Problem Requirement&lt;/h2&gt;
&lt;h3 id="input--output"&gt;Input / Output&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Input: &lt;code&gt;nums&lt;/code&gt;, with &lt;code&gt;1 &amp;lt;= nums.length &amp;lt;= 10&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Value range: &lt;code&gt;-10 &amp;lt;= nums[i] &amp;lt;= 10&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;All elements in &lt;code&gt;nums&lt;/code&gt; are distinct&lt;/li&gt;
&lt;li&gt;Output: return all possible subsets of &lt;code&gt;nums&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Ordering: the result order does not matter, and subset element order is not the point&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="example"&gt;Example&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: nums = [1,2,3]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This tutorial builds one minimal Python solution.&lt;/p&gt;
&lt;h2 id="start-from-the-search-tree-for-12"&gt;Start From the Search Tree for &lt;code&gt;[1,2]&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The smallest branching example is:&lt;/p&gt;</description></item><item><title>LeetCode 90: Subsets II, Derive Layer-Level Deduplication</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/90-subsets-ii/</link><pubDate>Sun, 03 May 2026 14:25:07 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/90-subsets-ii/</guid><description>&lt;h2 id="problem-requirement"&gt;Problem Requirement&lt;/h2&gt;
&lt;h3 id="input--output"&gt;Input / Output&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Input: &lt;code&gt;nums&lt;/code&gt;, with &lt;code&gt;1 &amp;lt;= nums.length &amp;lt;= 10&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Value range: &lt;code&gt;-10 &amp;lt;= nums[i] &amp;lt;= 10&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nums&lt;/code&gt; may contain duplicates&lt;/li&gt;
&lt;li&gt;Output: return all unique subsets&lt;/li&gt;
&lt;li&gt;Ordering: the result order does not matter, but the same value sequence may appear only once&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="example"&gt;Example&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Input: nums = [1,2,2]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Output: [[],[1],[1,2],[1,2,2],[2],[2,2]]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This tutorial starts with a correct but wasteful version, then derives sorting plus layer-level deduplication.&lt;/p&gt;
&lt;h2 id="start-from-duplicate-branches-in-122"&gt;Start From Duplicate Branches in &lt;code&gt;[1,2,2]&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The smallest example that exposes the issue is:&lt;/p&gt;</description></item><item><title>Hot100: Binary Tree Maximum Path Sum (Tree DP / Single-Side Gain ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/124-binary-tree-maximum-path-sum/</link><pubDate>Mon, 20 Apr 2026 10:01:46 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/124-binary-tree-maximum-path-sum/</guid><description>A practical guide to LeetCode 124 covering the key design split: return only the best single-side gain upward, while using the full path through the current node to update a global answer.</description></item><item><title>Hot100: Binary Tree Right Side View (Level Order Last-Node Rule ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/199-binary-tree-right-side-view/</link><pubDate>Mon, 20 Apr 2026 10:01:46 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/199-binary-tree-right-side-view/</guid><description>A practical guide to LeetCode 199 covering why the right side view is just the last node of each level, plus two stable solutions: level-order BFS and right-first DFS.</description></item><item><title>Hot100: Construct Binary Tree from Preorder and Inorder Traversal (Indexed Divide-and-Conquer ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/105-construct-binary-tree-from-preorder-and-inorder-traversal/</link><pubDate>Mon, 20 Apr 2026 10:01:46 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/105-construct-binary-tree-from-preorder-and-inorder-traversal/</guid><description>A practical guide to LeetCode 105 covering how preorder chooses the root, how inorder splits the subtrees, and how a hash map plus index recursion reduces reconstruction to O(n).</description></item><item><title>Hot100: Convert Sorted Array to Binary Search Tree (Midpoint Divide-and-Conquer ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/108-convert-sorted-array-to-binary-search-tree/</link><pubDate>Mon, 20 Apr 2026 10:01:46 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/108-convert-sorted-array-to-binary-search-tree/</guid><description>A practical guide to LeetCode 108 covering why the midpoint is the natural root, how sorted order and balance requirements work together, and how to build the BST with stable index recursion.</description></item><item><title>Hot100: Flatten Binary Tree to Linked List (Reverse Preorder Rewiring ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/114-flatten-binary-tree-to-linked-list/</link><pubDate>Mon, 20 Apr 2026 10:01:46 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/114-flatten-binary-tree-to-linked-list/</guid><description>A practical guide to LeetCode 114 covering why the flattened list must follow preorder order and how reverse preorder with a prev pointer gives a stable in-place rewiring strategy.</description></item><item><title>Hot100: Kth Smallest Element in a BST (Inorder Counting / Early Stop ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/230-kth-smallest-element-in-a-bst/</link><pubDate>Mon, 20 Apr 2026 10:01:46 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/230-kth-smallest-element-in-a-bst/</guid><description>A practical guide to LeetCode 230 covering why inorder traversal of a BST is sorted, how to count visits with an explicit stack, and how to stop immediately at the k-th node.</description></item><item><title>Hot100: Add Two Numbers Linked-List Carry Simulation ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/2-add-two-numbers/</link><pubDate>Mon, 20 Apr 2026 09:36:56 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/2-add-two-numbers/</guid><description>Add two non-negative integers stored in reverse-order linked lists by simulating grade-school addition with carry propagation. This ACERS guide derives the one-pass solution and includes runnable multi-language implementations.</description></item><item><title>Hot100: LRU Cache Hash Table + Doubly Linked List O(1) ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/146-lru-cache/</link><pubDate>Mon, 20 Apr 2026 09:36:56 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/146-lru-cache/</guid><description>Design an LRU cache where both get and put run in O(1) average time by combining a hash table with a doubly linked list. This ACERS guide derives the data-structure split and includes runnable multi-language implementations.</description></item><item><title>Hot100: Remove Nth Node From End of List One-Pass Two-Pointer ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/19-remove-nth-node-from-end-of-list/</link><pubDate>Mon, 20 Apr 2026 09:36:56 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/19-remove-nth-node-from-end-of-list/</guid><description>Remove the n-th node from the end of a singly linked list by turning backward counting into a fixed-gap two-pointer problem. This ACERS guide derives the one-pass solution and includes runnable multi-language code.</description></item><item><title>Hot100: Diameter of Binary Tree (Tree DP / Height Return ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/543-diameter-of-binary-tree/</link><pubDate>Sun, 19 Apr 2026 15:51:55 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/543-diameter-of-binary-tree/</guid><description>A practical guide to LeetCode 543 covering the key split between returned height and global diameter updates, plus engineering mappings and runnable multi-language implementations.</description></item><item><title>Hot100: Lowest Common Ancestor of a Binary Tree (Postorder Return Semantics ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/236-lowest-common-ancestor-of-a-binary-tree/</link><pubDate>Sun, 19 Apr 2026 15:51:55 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/236-lowest-common-ancestor-of-a-binary-tree/</guid><description>A practical guide to LeetCode 236 covering the return-value meaning in postorder recursion, when the current node becomes the answer, and why a node can be its own ancestor.</description></item><item><title>Hot100: Validate Binary Search Tree (Range Constraints / Inorder ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/98-validate-binary-search-tree/</link><pubDate>Sun, 19 Apr 2026 15:13:19 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/98-validate-binary-search-tree/</guid><description>A practical guide to LeetCode 98 covering ancestor range constraints, why parent-only checks fail, and two stable solutions: recursive bounds and inorder validation.</description></item><item><title>Hot100: N-Queens Incremental Build Tutorial</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/51-n-queens/</link><pubDate>Sun, 19 Apr 2026 14:49:56 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/51-n-queens/</guid><description>A teaching-first incremental tutorial for LeetCode 51 that grows the N-Queens solution from a tiny example and a minimal DFS into column and diagonal state optimization.</description></item><item><title>Hot100: Palindrome Partitioning (Backtracking / Palindrome Table ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/131-palindrome-partitioning/</link><pubDate>Sun, 19 Apr 2026 14:49:56 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/131-palindrome-partitioning/</guid><description>A practical guide to LeetCode 131 that builds string-partition backtracking from scratch and shows why a palindrome table makes the search cleaner and more reusable.</description></item><item><title>LeetCode 216: Combination Sum III (Backtracking / Fixed-Length Search ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/216-combination-sum-iii/</link><pubDate>Fri, 17 Apr 2026 14:31:12 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/216-combination-sum-iii/</guid><description>Learn LeetCode 216 by deriving fixed-length combination search, use-once recursion, and bounded 1..9 pruning from the problem itself.</description></item><item><title>LeetCode 40: Combination Sum II (Backtracking / Same-Layer Dedup ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/40-combination-sum-ii/</link><pubDate>Fri, 17 Apr 2026 14:31:10 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/40-combination-sum-ii/</guid><description>Learn LeetCode 40 by deriving same-layer duplicate skipping, use-once recursion, and sorted pruning from the problem itself.</description></item><item><title>Hot100: Combination Sum (Backtracking / Pruning ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/39-combination-sum/</link><pubDate>Wed, 08 Apr 2026 16:22:57 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/39-combination-sum/</guid><description>A practical guide to LeetCode 39 that builds combination backtracking from scratch, explains remain-based state, and shows why sorting makes pruning safe.</description></item><item><title>Hot100: Permutations (used[] Backtracking ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/46-permutations/</link><pubDate>Fri, 03 Apr 2026 17:54:22 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/backtracking/46-permutations/</guid><description>A practical guide to LeetCode 46 covering used[] state tracking, leaf-only collection, and runnable multi-language implementations.</description></item><item><title>LeetCode 133: Clone Graph Hash Map + DFS/BFS ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/133-clone-graph/</link><pubDate>Thu, 19 Mar 2026 13:18:26 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/133-clone-graph/</guid><description>Clone a connected undirected graph by mapping original nodes to cloned nodes, with DFS and BFS variants, cycle handling, correctness reasoning, and runnable implementations in six languages.</description></item><item><title>LeetCode 2089: Find Target Indices After Sorting Array ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/2089-find-target-indices-after-sorting-array/</link><pubDate>Wed, 18 Mar 2026 13:49:55 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/2089-find-target-indices-after-sorting-array/</guid><description>Sort the array, locate the target block with lower and upper bounds, and return every target index, with tradeoff analysis, engineering mappings, and runnable implementations in six languages.</description></item><item><title>LeetCode 2529: Maximum Count of Positive Integer and Negative Integer ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/2529-maximum-count-of-positive-integer-and-negative-integer/</link><pubDate>Wed, 18 Mar 2026 13:49:55 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/2529-maximum-count-of-positive-integer-and-negative-integer/</guid><description>Count negatives and positives in a sorted array by locating the boundaries around zero with lower-bound and upper-bound binary search, with engineering mappings and runnable implementations in six languages.</description></item><item><title>LeetCode 34: Find First and Last Position of Element in Sorted Array</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/34-find-first-and-last-position-of-element-in-sorted-array/</link><pubDate>Wed, 18 Mar 2026 13:49:55 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/34-find-first-and-last-position-of-element-in-sorted-array/</guid><description>Start from a linear-scan baseline, derive two half-open binary-search boundaries, and return the complete target range in O(log n) time.</description></item><item><title>LeetCode 35: Search Insert Position Lower-Bound Binary Search ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/35-search-insert-position/</link><pubDate>Wed, 18 Mar 2026 13:49:55 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/35-search-insert-position/</guid><description>Find the insertion index of a target in a sorted array with lower-bound binary search in O(log n), with boundary reasoning, engineering mappings, and runnable implementations in six languages.</description></item><item><title>LeetCode 744: Find Smallest Letter Greater Than Target Upper-Bound ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/744-find-smallest-letter-greater-than-target/</link><pubDate>Wed, 18 Mar 2026 13:49:55 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/binary-search/744-find-smallest-letter-greater-than-target/</guid><description>Find the smallest character strictly greater than a target in a sorted circular array by using upper-bound binary search and wrap-around logic, with pitfalls, engineering mappings, and runnable implementations in six languages.</description></item><item><title>Hot100: Binary Tree Level Order Traversal (BFS / DFS ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/102-binary-tree-level-order-traversal/</link><pubDate>Mon, 16 Mar 2026 13:00:56 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/102-binary-tree-level-order-traversal/</guid><description>A practical guide to LeetCode 102 covering level-by-level BFS, level-size boundaries, DFS depth buckets, and runnable multi-language implementations.</description></item><item><title>Hot100: Symmetric Tree (Mirror Recursion / BFS ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/101-symmetric-tree/</link><pubDate>Mon, 16 Mar 2026 13:00:55 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/101-symmetric-tree/</guid><description>A practical guide to LeetCode 101 covering mirror recursion, pairwise BFS checks, symmetry contracts, and runnable multi-language implementations.</description></item><item><title>Hot100: Same Tree (Synchronous Recursion / BFS ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/100-same-tree/</link><pubDate>Mon, 16 Mar 2026 13:00:54 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/100-same-tree/</guid><description>A practical guide to LeetCode 100 covering synchronous recursion, pairwise BFS validation, structural equivalence, and runnable multi-language implementations.</description></item><item><title>Hot100: Invert Binary Tree (Recursion / BFS ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/226-invert-binary-tree/</link><pubDate>Fri, 06 Mar 2026 17:58:23 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/226-invert-binary-tree/</guid><description>A practical guide to LeetCode 226 covering tree mirroring, recursive left-right swaps, BFS traversal, and engineering mappings.</description></item><item><title>Hot100: Maximum Depth of Binary Tree (DFS / BFS ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/104-maximum-depth-of-binary-tree/</link><pubDate>Fri, 06 Mar 2026 17:58:22 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/104-maximum-depth-of-binary-tree/</guid><description>A practical guide to LeetCode 104 covering the depth definition, recursive DFS, level-order BFS, engineering mappings, and runnable multi-language implementations.</description></item><item><title>Hot100: Binary Tree Inorder Traversal (Recursion / Stack ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/94-binary-tree-inorder-traversal/</link><pubDate>Fri, 06 Mar 2026 17:58:21 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/binary-tree/94-binary-tree-inorder-traversal/</guid><description>A practical guide to LeetCode 94 covering left-root-right traversal, recursion, explicit stacks, engineering mappings, and runnable multi-language implementations.</description></item><item><title>LeetCode 146: LRU Cache Design with O(1) Hash Map + Doubly Linked List</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/146-lru-cache/</link><pubDate>Thu, 12 Feb 2026 13:51:08 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/146-lru-cache/</guid><description>Implement LRUCache with O(1) average get/put by combining a hash map for lookup and a doubly linked list for recency order. Includes ACERS reasoning, engineering mapping, and runnable multi-language code.</description></item><item><title>LeetCode 19: Remove Nth Node From End of List (One-pass Two Pointers) ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/19-remove-nth-node-from-end-of-list/</link><pubDate>Thu, 12 Feb 2026 13:50:28 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/19-remove-nth-node-from-end-of-list/</guid><description>From naive two-pass traversal to one-pass fast/slow pointers, this ACERS guide explains Remove Nth Node From End of List with correctness intuition, edge cases, engineering mappings, and runnable multi-language code.</description></item><item><title>LeetCode 138: Copy List with Random Pointer — A Complete Deep-Copy Breakdown</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/linked-list/138-copy-list-with-random-pointer/</link><pubDate>Wed, 11 Feb 2026 07:59:32 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/linked-list/138-copy-list-with-random-pointer/</guid><description>The core of copying a random-pointer list is mapping original node identity to copied node identity, then rebuilding next/random pointers. This article uses the ACERS structure to cover intuition, engineering analogies, pitfalls, and runnable multi-language implementations.</description></item><item><title>LeetCode 2: Add Two Numbers from Naive to Optimal Carry Simulation</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/2-add-two-numbers/</link><pubDate>Wed, 11 Feb 2026 07:54:26 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/2-add-two-numbers/</guid><description>Add two non-negative integers represented by reverse-order linked lists. This ACERS-style guide explains digit-by-digit carry propagation with engineering mappings and runnable multi-language code.</description></item><item><title>Hot100: Sort List Linked-List Merge Sort ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/148-sort-list/</link><pubDate>Tue, 10 Feb 2026 17:07:38 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/148-sort-list/</guid><description>Sort a singly linked list in O(n log n) time using split + recursive merge sort. This guide explains derivation, invariants, engineering mappings, and runnable multi-language implementations.</description></item><item><title>Hot100: Merge K Sorted Lists Divide-and-Conquer O(N log k) ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/23-merge-k-sorted-lists/</link><pubDate>Tue, 10 Feb 2026 17:05:53 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/23-merge-k-sorted-lists/</guid><description>Upgrade from LeetCode 21 to k-way merge: derive why sequential merge degrades, then use divide-and-conquer to reach O(N log k), with heap comparison and runnable multi-language implementations.</description></item><item><title>Hot100: Linked List Cycle II Floyd Detection + Entry Localization ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/142-linked-list-cycle-ii/</link><pubDate>Tue, 10 Feb 2026 10:47:56 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/142-linked-list-cycle-ii/</guid><description>Return the first node where a singly linked list enters a cycle without modifying the list: use Floyd fast/slow pointers to detect a meeting point, then reset one pointer to head and move both one step to localize the entry in O(n) time and O(1) space.</description></item><item><title>Hot100: Merge Two Sorted Lists Sentinel Two-Pointer Merge ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/21-merge-two-sorted-lists/</link><pubDate>Tue, 10 Feb 2026 10:47:02 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/21-merge-two-sorted-lists/</guid><description>Merge two sorted linked lists in O(m+n) with sentinel node and two pointers, with iterative and recursive comparison, engineering mapping, and runnable multi-language implementations.</description></item><item><title>Hot100: First Missing Positive In-Place Index Placement ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/41-first-missing-positive/</link><pubDate>Tue, 10 Feb 2026 10:25:53 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/41-first-missing-positive/</guid><description>Find the first missing positive in O(n) time and O(1) extra space using in-place index placement (value x should be placed at index x-1), with engineering mapping, pitfalls, and runnable multi-language implementations.</description></item><item><title>Hot100: Reverse Nodes in k-Group Group-Wise In-Place ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/25-reverse-nodes-in-k-group/</link><pubDate>Tue, 10 Feb 2026 10:25:53 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/25-reverse-nodes-in-k-group/</guid><description>Reverse a linked list in groups of k nodes in-place, leaving the last group unchanged if its size is smaller than k. This guide presents a dummy-node + kth-scan + in-place reversal template in O(n) time and O(1) extra space.</description></item><item><title>Hot100: Reorder List In-Place Split-Reverse-Merge ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/143-reorder-list/</link><pubDate>Tue, 10 Feb 2026 09:57:31 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/143-reorder-list/</guid><description>Reorder a linked list to L0-&amp;gt;Ln-&amp;gt;L1-&amp;gt;Ln-1... in O(n) time and O(1) extra space using split, reverse, and alternating merge, with derivation, pitfalls, and runnable multi-language implementations.</description></item><item><title>Hot100: Reverse Linked List II Dummy Node + Head-Insertion ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/92-reverse-linked-list-ii/</link><pubDate>Tue, 10 Feb 2026 09:56:14 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/92-reverse-linked-list-ii/</guid><description>Reverse only the interval [left, right] in a singly linked list using a dummy node and in-place head insertion. O(n) time, O(1) extra space, with derivation, pitfalls, and runnable multi-language implementations.</description></item><item><title>Hot100: Linked List Cycle Floyd Fast/Slow Pointer ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/141-linked-list-cycle/</link><pubDate>Tue, 10 Feb 2026 08:55:58 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/141-linked-list-cycle/</guid><description>Detect whether a singly linked list has a cycle using Floyd fast/slow pointers in O(n) time and O(1) extra space, with proof intuition, pitfalls, engineering mapping, and runnable multi-language implementations.</description></item><item><title>Hot100: Palindrome Linked List Fast/Slow + Reverse Second Half O(1) Space ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/234-palindrome-linked-list/</link><pubDate>Mon, 09 Feb 2026 17:38:32 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/234-palindrome-linked-list/</guid><description>Check whether a singly linked list is a palindrome in O(n) time and O(1) extra space: find middle with fast/slow pointers, reverse second half, compare, then restore list structure.</description></item><item><title>Hot100: Reverse Linked List Three-Pointer Iterative/Recursive ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/206-reverse-linked-list/</link><pubDate>Mon, 09 Feb 2026 17:27:59 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/206-reverse-linked-list/</guid><description>Reverse a singly linked list in O(n) time and O(1) extra space with the three-pointer iterative template, with recursive comparison, engineering mapping, and runnable multi-language implementations.</description></item><item><title>Hot100: Subarray Sum Equals K Prefix Sum + Hash Map ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/560-subarray-sum-equals-k/</link><pubDate>Mon, 09 Feb 2026 13:19:45 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/560-subarray-sum-equals-k/</guid><description>Count subarrays whose sum equals k in O(n) using prefix sum and frequency hash map, with engineering scenarios, pitfalls, and runnable multi-language implementations.</description></item><item><title>Graph Algorithms Learning Path: From BFS to Graph Computation Models</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/00-graph-algorithms-learning-path/</link><pubDate>Mon, 09 Feb 2026 10:14:45 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/00-graph-algorithms-learning-path/</guid><description>A graph algorithms topic guide and recommended reading order covering BFS/DFS, reachability, shortest paths, CC/SCC, centrality, PageRank, community detection, subgraph matching, dynamic graphs, graph partitioning, and graph computation models.</description></item><item><title>Practical Graph Computation Models: How Pregel (BSP) and GAS Run PageRank/CC/Parallel BFS</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/110-graph-computation-models-pregel-gas-parallel-bfs/</link><pubDate>Mon, 09 Feb 2026 10:05:33 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/110-graph-computation-models-pregel-gas-parallel-bfs/</guid><description>An engineering implementation framework centered on graph computation models: core abstractions, synchronization semantics, performance boundaries of Pregel and GAS, plus implementation and selection guidance for PageRank/CC/parallel BFS.</description></item><item><title>Graph Partitioning Algorithms: Edge-cut vs Vertex-cut and an Engineering Guide to METIS</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/100-graph-partitioning-edge-cut-vertex-cut-metis/</link><pubDate>Mon, 09 Feb 2026 10:04:05 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/100-graph-partitioning-edge-cut-vertex-cut-metis/</guid><description>A practical graph partitioning guide for production graph databases, covering Edge-cut vs Vertex-cut, the core METIS workflow, runnable examples, and an engineering tuning checklist.</description></item><item><title>Dynamic Graphs and Incremental Computation: ACERS Guide to Incremental Shortest Path, Incremental PageRank, and Connectivity Maintenance</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/90-dynamic-graph-incremental-computation/</link><pubDate>Mon, 09 Feb 2026 10:00:28 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/90-dynamic-graph-incremental-computation/</guid><description>For real-world graph systems, this article systematically explains dynamic graph incremental algorithms: incremental shortest path, incremental PageRank, and connectivity maintenance. It focuses on three core engineering techniques: local recomputation, lazy updates, and approximate results.</description></item><item><title>Community Detection Primer: Engineering Trade-offs Between Louvain and Label Propagation - ACERS Analysis</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/80-community-detection-louvain-label-propagation/</link><pubDate>Mon, 09 Feb 2026 09:59:58 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/80-community-detection-louvain-label-propagation/</guid><description>Centered on three core community-detection use cases (group identification, graph partitioning, and cold-start analysis), this article explains Louvain and Label Propagation with principles, complexity, engineering trade-offs, and runnable multi-language implementations.</description></item><item><title>Subgraph Matching / Pattern Matching: VF2, Ullmann, and Engineering-Grade Pruning - ACERS Analysis</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/70-subgraph-matching-vf2-ullmann-and-pruning/</link><pubDate>Mon, 09 Feb 2026 09:59:16 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/70-subgraph-matching-vf2-ullmann-and-pruning/</guid><description>A systematic guide to Subgraph Isomorphism (NP-hard) and the core ideas of VF2/Ullmann, with emphasis on engineering reality: constrained pattern queries and candidate pruning usually matter more than the algorithm name itself.</description></item><item><title>The Graph Centrality Trio: Degree, Betweenness, and Closeness - ACERS Engineering Analysis</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/50-graph-centrality-degree-betweenness-closeness/</link><pubDate>Mon, 09 Feb 2026 09:56:11 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/50-graph-centrality-degree-betweenness-closeness/</guid><description>A systematic guide to the three core graph centrality metrics: Degree, Betweenness, and Closeness. The key engineering takeaway: most production systems prioritize Degree and approximate Betweenness, with clear complexity and rollout tradeoffs.</description></item><item><title>PageRank / Personalized PageRank: Node Importance and Incremental Updates in Graph Databases - ACERS Analysis</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/60-pagerank-and-personalized-pagerank/</link><pubDate>Mon, 09 Feb 2026 09:54:25 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/60-pagerank-and-personalized-pagerank/</guid><description>A systematic explanation of PageRank and Personalized PageRank, from iterative computation and sparse-matrix implementation to incremental update strategies, covering core graph-database scenarios such as recommendation and influence analysis.</description></item><item><title>k-hop and Reachability Queries: BFS Limits, Reachability Indexes, and 2-hop Labeling ACERS Analysis</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/30-k-hop-reachability-and-reach-index/</link><pubDate>Mon, 09 Feb 2026 09:52:17 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/30-k-hop-reachability-and-reach-index/</guid><description>A systematic engineering guide to k-hop and reachability queries: BFS+hop limits, why full transitive closure is usually not maintained, and practical bitmap/2-hop reach-index strategies with runnable multi-language code.</description></item><item><title>Connected Components and Strongly Connected Components: Tarjan / Kosaraju ACERS Engineering Analysis</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/40-connected-components-and-scc-tarjan-kosaraju/</link><pubDate>Mon, 09 Feb 2026 09:50:22 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/40-connected-components-and-scc-tarjan-kosaraju/</guid><description>A systematic guide to undirected Connected Components and directed SCCs, with emphasis on Tarjan (common in production) and Kosaraju, mapped to graph-database scenarios such as community pre-grouping, subgraph splitting, and partition hints.</description></item><item><title>Shortest Path Core Trio: BFS, Dijkstra, and A* ACERS Engineering Breakdown</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/20-shortest-path-bfs-dijkstra-astar-acers/</link><pubDate>Mon, 09 Feb 2026 09:48:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/20-shortest-path-bfs-dijkstra-astar-acers/</guid><description>A full engineering walkthrough of the shortest-path core trio: BFS for unweighted graphs, Dijkstra for non-negative weights, and heuristic A*. Includes multi-source BFS, bidirectional search, path pruning, and runnable multi-language templates.</description></item><item><title>BFS / DFS Engineering Primer: k-hop Queries, Subgraph Extraction, and Path Existence ACERS Breakdown</title><link>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/10-bfs-dfs-k-hop-subgraph-path-existence/</link><pubDate>Mon, 09 Feb 2026 09:44:11 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/algorithm/graph/10-bfs-dfs-k-hop-subgraph-path-existence/</guid><description>Centered on three high-frequency graph tasks (k-hop query, subgraph extraction, and path existence), this article explains practical BFS/DFS iteration templates, early-stop pruning, and visited bitmap/bloom choices with runnable multi-language implementations.</description></item><item><title>Hot100: Intersection of Two Linked Lists Two-Pointer Switch-Head O(1) Space ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/160-intersection-of-two-linked-lists/</link><pubDate>Mon, 09 Feb 2026 09:26:37 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/160-intersection-of-two-linked-lists/</guid><description>Find the intersection node of two singly linked lists without modifying structure: two pointers switching heads synchronize in O(m+n) time and O(1) extra space, with derivation, engineering mapping, and multi-language implementations.</description></item><item><title>Path Sum III: Prefix Sum + Hash Map Counting Downward Paths (LeetCode 437) ACERS Guide</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/437-path-sum-iii/</link><pubDate>Wed, 04 Feb 2026 16:02:26 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/437-path-sum-iii/</guid><description>Count downward paths in a binary tree whose sum equals targetSum in O(n) using prefix sums and a frequency hash map, with derivation, engineering mapping, and multi-language implementations.</description></item><item><title>Hot100: Spiral Matrix (Boundary Shrinking Simulation ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/54-spiral-matrix/</link><pubDate>Tue, 03 Feb 2026 10:01:50 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/54-spiral-matrix/</guid><description>Traverse a matrix in clockwise spiral order in O(mn) using boundary shrinking. Includes engineering scenarios, pitfalls, and multi-language implementations.</description></item><item><title>CNN, RNN, LSTM, and Transformer: Differences and When to Use Each</title><link>https://jeanphilogong.github.io/jeanblog/ai/architecture/cnn-rnn-lstm-transformer-comparison/</link><pubDate>Mon, 26 Jan 2026 16:24:56 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/ai/architecture/cnn-rnn-lstm-transformer-comparison/</guid><description>Using dependency path length and resource complexity, this article compares CNN, RNN, LSTM, and Transformer, and provides runnable examples plus a selection workflow.</description></item><item><title>LeetCode 42: How Much Rain Water Can an Elevation Map Hold?</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/42-trapping-rain-water/</link><pubDate>Sat, 24 Jan 2026 10:40:53 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/42-trapping-rain-water/</guid><description>Start with one position, derive boundary arrays and an O(1)-space two-pointer solution, then connect the same boundary model to a monotonic stack.</description></item><item><title>Hot100: Maximum Subarray (Kadane O(n) ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/53-maximum-subarray/</link><pubDate>Fri, 23 Jan 2026 13:21:02 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/hot100/53-maximum-subarray/</guid><description>Use Kadane&amp;#39;s algorithm to compute the maximum subarray sum in O(n). Includes engineering scenarios, pitfalls, and multi-language implementations.</description></item><item><title>LeetCode 1437: Check If All 1's Are at Least K Apart (ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/1437-check-if-all-ones-are-at-least-k-places-away/</link><pubDate>Thu, 22 Jan 2026 10:49:42 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/1437-check-if-all-ones-are-at-least-k-places-away/</guid><description>One-pass check to ensure all 1s are at least k apart. Includes engineering scenarios, pitfalls, and multi-language implementations.</description></item><item><title>LeetCode 231: Power of Two (Bit Trick O(1) ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/231-power-of-two/</link><pubDate>Wed, 21 Jan 2026 14:06:56 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/231-power-of-two/</guid><description>Judge whether an integer is a power of two in O(1) time using bit tricks. Includes engineering scenarios, pitfalls, and multi-language solutions.</description></item><item><title>LeetCode 1456: Maximum Number of Vowels in a Substring of Given Length (ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/1456-maximum-number-of-vowels-in-a-substring-of-given-length/</link><pubDate>Tue, 20 Jan 2026 13:40:45 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/1456-maximum-number-of-vowels-in-a-substring-of-given-length/</guid><description>Use a fixed-size sliding window to compute the maximum number of vowels in O(n). Includes engineering scenarios and multi-language implementations.</description></item><item><title>LeetCode 239: Sliding Window Maximum</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/239-sliding-window-maximum/</link><pubDate>Mon, 19 Jan 2026 17:46:14 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/239-sliding-window-maximum/</guid><description>Solve LeetCode 239 by defining complete windows, building a correct scan, and deriving an O(n) index-deque solution.</description></item><item><title>What Is size_t? Why C++ Loops Prefer size_t Over int</title><link>https://jeanphilogong.github.io/jeanblog/dev/c++/size_t-why-not-int-loop/</link><pubDate>Tue, 30 Dec 2025 18:12:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/c++/size_t-why-not-int-loop/</guid><description>&lt;h1 id="what-is-size_"&gt;&lt;strong&gt;What Is size_t? Why C++ Loops Prefer size_t Over int&lt;/strong&gt;&lt;/h1&gt;
&lt;h3 id="subtitle--abstract"&gt;Subtitle / Abstract&lt;/h3&gt;
&lt;p&gt;When you iterate containers with a &lt;code&gt;for&lt;/code&gt; loop, &lt;code&gt;size_t&lt;/code&gt; is often safer and closer to the intended meaning than &lt;code&gt;int&lt;/code&gt;. This post uses the ACERS structure to explain what &lt;code&gt;size_t&lt;/code&gt; is, why it is used, the common pitfalls, and practical patterns for production C++.&lt;/p&gt;
&lt;h3 id="meta"&gt;Meta&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Reading time: 8-10 minutes&lt;/li&gt;
&lt;li&gt;Tags: C++, size_t, type system, loops, STL&lt;/li&gt;
&lt;li&gt;SEO keywords: size_t usage, size_t vs int, C++ loop initialization, size_t underflow&lt;/li&gt;
&lt;li&gt;Meta description: Explain size_t and why loops often use it, with safe patterns and engineering scenarios.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="target-readers"&gt;Target readers&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;C++ beginners who are new to &lt;code&gt;size_t&lt;/code&gt;, &lt;code&gt;sizeof&lt;/code&gt;, and container &lt;code&gt;size()&lt;/code&gt; return types&lt;/li&gt;
&lt;li&gt;Mid-level engineers who have seen &lt;code&gt;-Wsign-compare&lt;/code&gt; warnings or unsigned underflow bugs&lt;/li&gt;
&lt;li&gt;Engineers writing cross-platform or high-performance C++&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="background--motivation"&gt;Background / Motivation&lt;/h3&gt;
&lt;p&gt;In C++ code, you often see loops like:&lt;/p&gt;</description></item><item><title>LeetCode 1512: Number of Good Pairs (Hash Counting ACERS Guide)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/1512-number-of-good-pairs/</link><pubDate>Tue, 30 Dec 2025 11:40:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/1512-number-of-good-pairs/</guid><description>Solve Good Pairs with one-pass hash counting, plus engineering scenarios, complexity, and multi-language solutions.</description></item><item><title>XOR and RC4: From Principles to Go Practice (with Safer Alternatives)</title><link>https://jeanphilogong.github.io/jeanblog/dev/go/xor-rec4-primer/</link><pubDate>Tue, 16 Dec 2025 18:12:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/go/xor-rec4-primer/</guid><description>An intro to XOR and RC4 for Go/backend engineers, with runnable examples and safer alternatives.</description></item><item><title>Sorting Series (Final): Practical Selection - Choose by Scale, Stability, Memory, Distribution</title><link>https://jeanphilogong.github.io/jeanblog/alg/sorting/9.sorting-series-selection-guide/</link><pubDate>Tue, 09 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/sorting/9.sorting-series-selection-guide/</guid><description>Practical selection guide: decision tables by scale/distribution/stability/memory, engineering scenarios, test checklist, and common pitfalls to apply the series.</description></item><item><title>Do Not Let AI Drive You: Keep the Ability to Build Independently</title><link>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/ai-usage-self-control/</link><pubDate>Mon, 08 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/ai-usage-self-control/</guid><description>How to avoid copy-paste dependence when using AI for coding: Feynman technique, deliberate practice, retrieval practice, and a practical self-check workflow.</description></item><item><title>Emmet-Vim Speed Guide: Write HTML/CSS with Abbreviations</title><link>https://jeanphilogong.github.io/jeanblog/dev/frontend/emmet-vim-guide/</link><pubDate>Mon, 08 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/frontend/emmet-vim-guide/</guid><description>Practical Emmet notes for Vim/Neovim users: install, key mappings, runnable examples, validation checklist, and common pitfalls to 3x your page and component speed.</description></item><item><title>Sorting Series (8): TimSort and Introsort - Engineering Patterns Behind Built-in Sorts</title><link>https://jeanphilogong.github.io/jeanblog/alg/sorting/8.sorting-series-timsort-introsort/</link><pubDate>Mon, 08 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/sorting/8.sorting-series-timsort-introsort/</guid><description>Explain Python/Java TimSort and C++ std::sort Introsort: triggers, stability, complexity, trade-offs, with skeletons and selection guidance.</description></item><item><title>Sorting Series (7): Non-Comparison Sorting - Counting, Bucket, Radix and the Range/Digit Tradeoff</title><link>https://jeanphilogong.github.io/jeanblog/alg/sorting/7.sorting-series-non-comparison/</link><pubDate>Sun, 07 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/sorting/7.sorting-series-non-comparison/</guid><description>Explain prerequisites, complexity, implementation details, and pitfalls of non-comparison sorts with multilingual examples for counting, bucket, and radix.</description></item><item><title>Svelte Button Configuration Guide: States, Styles, and Accessibility</title><link>https://jeanphilogong.github.io/jeanblog/dev/frontend/svelte-button-config-guide/</link><pubDate>Sun, 07 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/frontend/svelte-button-config-guide/</guid><description>Build reusable buttons in Svelte: dynamic classes, optional chaining and nullish coalescing, safe defaults, state-driven styles, accessibility, testing, and common pitfalls.</description></item><item><title>Sorting Series (6): Heap Sort - In-place O(n log n) with Worst-Case Guarantees</title><link>https://jeanphilogong.github.io/jeanblog/alg/sorting/6.sorting-series-heap-sort/</link><pubDate>Sat, 06 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/sorting/6.sorting-series-heap-sort/</guid><description>Explain heap sort principles, complexity, and engineering scenarios; compare with quick/merge; include multilingual implementations and top-k examples.</description></item><item><title>Sorting Series (5): Quick Sort - Pivot Strategy, Tail Recursion, Engineering Practice</title><link>https://jeanphilogong.github.io/jeanblog/alg/sorting/5.sorting-series-quick-sort/</link><pubDate>Fri, 05 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/sorting/5.sorting-series-quick-sort/</guid><description>Comprehensive quicksort guide: pivot selection, three-way partitioning, tail recursion optimization, hybrid sorting practices, with multilingual implementations and engineering guidance.</description></item><item><title>LeetCode 1: Two Sum (Hash Map ACERS Summary)</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/1-two-sum/</link><pubDate>Thu, 04 Dec 2025 11:10:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/1-two-sum/</guid><description>&lt;h1 id="leetcode-1-two-sum"&gt;LeetCode 1: Two Sum&lt;/h1&gt;
&lt;h2 id="summary"&gt;Summary&lt;/h2&gt;
&lt;p&gt;Find two indices such that &lt;code&gt;nums[i] + nums[j] = target&lt;/code&gt;. Use a hash map for O(n) time.&lt;/p&gt;
&lt;h2 id="approach"&gt;Approach&lt;/h2&gt;
&lt;p&gt;Iterate and store &lt;code&gt;value -&amp;gt; index&lt;/code&gt;. For each number &lt;code&gt;x&lt;/code&gt;, check if &lt;code&gt;target - x&lt;/code&gt; exists.&lt;/p&gt;
&lt;h2 id="complexity"&gt;Complexity&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Time: O(n)&lt;/li&gt;
&lt;li&gt;Space: O(n)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="python-reference-implementation"&gt;Python reference implementation&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;two_sum&lt;/span&gt;(nums, target):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; seen &lt;span style="color:#f92672"&gt;=&lt;/span&gt; {}
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; i, x &lt;span style="color:#f92672"&gt;in&lt;/span&gt; enumerate(nums):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; y &lt;span style="color:#f92672"&gt;=&lt;/span&gt; target &lt;span style="color:#f92672"&gt;-&lt;/span&gt; x
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; y &lt;span style="color:#f92672"&gt;in&lt;/span&gt; seen:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; [seen[y], i]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; seen[x] &lt;span style="color:#f92672"&gt;=&lt;/span&gt; i
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>LeetCode 2300: Successful Pairs of Spells and Potions</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/2300-successful-pairs-of-spells-and-potions/</link><pubDate>Thu, 04 Dec 2025 11:10:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/2300-successful-pairs-of-spells-and-potions/</guid><description>&lt;h1 id="leetcode-2300-successful-pairs-of-spells-and-potions"&gt;LeetCode 2300: Successful Pairs of Spells and Potions&lt;/h1&gt;
&lt;h2 id="summary"&gt;Summary&lt;/h2&gt;
&lt;p&gt;For each spell, count how many potions make &lt;code&gt;spell * potion &amp;gt;= success&lt;/code&gt;. Sort potions and binary search the threshold.&lt;/p&gt;
&lt;h2 id="approach"&gt;Approach&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Sort potions.&lt;/li&gt;
&lt;li&gt;For each spell, compute &lt;code&gt;need = ceil(success / spell)&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Use binary search to find the first potion &amp;gt;= need.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="complexity"&gt;Complexity&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Time: O(n log n)&lt;/li&gt;
&lt;li&gt;Space: O(1) extra (or O(n) if sorting a copy)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="python-reference-implementation"&gt;Python reference implementation&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; bisect
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;import&lt;/span&gt; math
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;successful_pairs&lt;/span&gt;(spells, potions, success):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; potions &lt;span style="color:#f92672"&gt;=&lt;/span&gt; sorted(potions)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; n &lt;span style="color:#f92672"&gt;=&lt;/span&gt; len(potions)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; res &lt;span style="color:#f92672"&gt;=&lt;/span&gt; []
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; s &lt;span style="color:#f92672"&gt;in&lt;/span&gt; spells:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; need &lt;span style="color:#f92672"&gt;=&lt;/span&gt; (success &lt;span style="color:#f92672"&gt;+&lt;/span&gt; s &lt;span style="color:#f92672"&gt;-&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;) &lt;span style="color:#f92672"&gt;//&lt;/span&gt; s
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; idx &lt;span style="color:#f92672"&gt;=&lt;/span&gt; bisect&lt;span style="color:#f92672"&gt;.&lt;/span&gt;bisect_left(potions, need)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; res&lt;span style="color:#f92672"&gt;.&lt;/span&gt;append(n &lt;span style="color:#f92672"&gt;-&lt;/span&gt; idx)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; res
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>LeetCode 2379: Minimum Recolors to Get K Consecutive Black Blocks</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/2379-minimum-recolors-to-get-k-consecutive-black-blocks/</link><pubDate>Thu, 04 Dec 2025 11:10:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/2379-minimum-recolors-to-get-k-consecutive-black-blocks/</guid><description>&lt;h1 id="leetcode-2379-minimum-recolors-to-get-k-consecutive-black-blocks"&gt;LeetCode 2379: Minimum Recolors to Get K Consecutive Black Blocks&lt;/h1&gt;
&lt;h2 id="summary"&gt;Summary&lt;/h2&gt;
&lt;p&gt;Given a string of &amp;lsquo;B&amp;rsquo; and &amp;lsquo;W&amp;rsquo;, find the minimum recolors to make a substring of length &lt;code&gt;k&lt;/code&gt; all black.&lt;/p&gt;
&lt;h2 id="approach"&gt;Approach&lt;/h2&gt;
&lt;p&gt;Use a sliding window of length &lt;code&gt;k&lt;/code&gt; and count the number of whites in the window. The minimum whites across all windows is the answer.&lt;/p&gt;
&lt;h2 id="complexity"&gt;Complexity&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Time: O(n)&lt;/li&gt;
&lt;li&gt;Space: O(1)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="python-reference-implementation"&gt;Python reference implementation&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;minimum_recolors&lt;/span&gt;(blocks, k):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; whites &lt;span style="color:#f92672"&gt;=&lt;/span&gt; sum(&lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; c &lt;span style="color:#f92672"&gt;in&lt;/span&gt; blocks[:k] &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; c &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;W&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ans &lt;span style="color:#f92672"&gt;=&lt;/span&gt; whites
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; i &lt;span style="color:#f92672"&gt;in&lt;/span&gt; range(k, len(blocks)):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; blocks[i&lt;span style="color:#f92672"&gt;-&lt;/span&gt;k] &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;W&amp;#39;&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; whites &lt;span style="color:#f92672"&gt;-=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; blocks[i] &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#39;W&amp;#39;&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; whites &lt;span style="color:#f92672"&gt;+=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ans &lt;span style="color:#f92672"&gt;=&lt;/span&gt; min(ans, whites)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; ans
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>LeetCode 2841: Maximum Sum of Almost Unique Subarray</title><link>https://jeanphilogong.github.io/jeanblog/alg/leetcode/2841-maximum-sum-of-almost-unique-subarray/</link><pubDate>Thu, 04 Dec 2025 11:10:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/leetcode/2841-maximum-sum-of-almost-unique-subarray/</guid><description>&lt;h1 id="leetcode-2841-maximum-sum-of-almost-unique-subarray"&gt;LeetCode 2841: Maximum Sum of Almost Unique Subarray&lt;/h1&gt;
&lt;h2 id="summary"&gt;Summary&lt;/h2&gt;
&lt;p&gt;Given an array, window size &lt;code&gt;k&lt;/code&gt;, and threshold &lt;code&gt;m&lt;/code&gt;, find the maximum sum of any length-&lt;code&gt;k&lt;/code&gt; subarray that contains at least &lt;code&gt;m&lt;/code&gt; distinct elements.&lt;/p&gt;
&lt;h2 id="approach"&gt;Approach&lt;/h2&gt;
&lt;p&gt;Use a sliding window with a frequency map, track window sum and number of distinct values.&lt;/p&gt;
&lt;h2 id="complexity"&gt;Complexity&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Time: O(n)&lt;/li&gt;
&lt;li&gt;Space: O(n) for frequency map&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="python-reference-implementation"&gt;Python reference implementation&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;def&lt;/span&gt; &lt;span style="color:#a6e22e"&gt;max_sum_almost_unique&lt;/span&gt;(nums, m, k):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#f92672"&gt;from&lt;/span&gt; collections &lt;span style="color:#f92672"&gt;import&lt;/span&gt; defaultdict
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; count &lt;span style="color:#f92672"&gt;=&lt;/span&gt; defaultdict(int)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; distinct &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; window_sum &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ans &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;for&lt;/span&gt; i, x &lt;span style="color:#f92672"&gt;in&lt;/span&gt; enumerate(nums):
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; window_sum &lt;span style="color:#f92672"&gt;+=&lt;/span&gt; x
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; count[x] &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; distinct &lt;span style="color:#f92672"&gt;+=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; count[x] &lt;span style="color:#f92672"&gt;+=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; i &lt;span style="color:#f92672"&gt;&amp;gt;=&lt;/span&gt; k:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; y &lt;span style="color:#f92672"&gt;=&lt;/span&gt; nums[i &lt;span style="color:#f92672"&gt;-&lt;/span&gt; k]
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; window_sum &lt;span style="color:#f92672"&gt;-=&lt;/span&gt; y
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; count[y] &lt;span style="color:#f92672"&gt;-=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; count[y] &lt;span style="color:#f92672"&gt;==&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;0&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; distinct &lt;span style="color:#f92672"&gt;-=&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; i &lt;span style="color:#f92672"&gt;&amp;gt;=&lt;/span&gt; k &lt;span style="color:#f92672"&gt;-&lt;/span&gt; &lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; &lt;span style="color:#f92672"&gt;and&lt;/span&gt; distinct &lt;span style="color:#f92672"&gt;&amp;gt;=&lt;/span&gt; m:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; ans &lt;span style="color:#f92672"&gt;=&lt;/span&gt; max(ans, window_sum)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; ans
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Sorting Series (4): Merge Sort - Stable Divide and Conquer and External Sorting</title><link>https://jeanphilogong.github.io/jeanblog/alg/sorting/4.sorting-series-merge-sort/</link><pubDate>Thu, 04 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/sorting/4.sorting-series-merge-sort/</guid><description>Systematic explanation of merge sort principles, stability, space trade-offs, and engineering scenarios with Python/C/C++/Go/Rust/JS implementations and external sorting guidance.</description></item><item><title>Sorting Series (3): Shell Sort - From Insertion to Gap-Based Efficiency</title><link>https://jeanphilogong.github.io/jeanblog/alg/sorting/3.sorting-series-shell-sort/</link><pubDate>Wed, 03 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/sorting/3.sorting-series-shell-sort/</guid><description>Explain Shell sort principles, gap strategies, and engineering usage with scenarios and Python/C/C++/Go/Rust/JS implementations.</description></item><item><title>Sorting Series (2): Bubble, Selection, Insertion - Three O(n^2) Baselines</title><link>https://jeanphilogong.github.io/jeanblog/alg/sorting/2.sorting-series-on2-baseline/</link><pubDate>Tue, 02 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/sorting/2.sorting-series-on2-baseline/</guid><description>Systematic ACERS explanation of bubble/selection/insertion sorts: principles, stability, scenarios, and multilingual implementations with selection guidance.</description></item><item><title>Sorting Series (1): How to Choose an Algorithm - Time, Space, Stability, Scenarios</title><link>https://jeanphilogong.github.io/jeanblog/alg/sorting/1.sorting-series-preface/</link><pubDate>Mon, 01 Dec 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/alg/sorting/1.sorting-series-preface/</guid><description>Use the ACERS template to map common sorting algorithms by scenario, complexity, stability, and engineering usage, with runnable examples and a selection checklist.</description></item><item><title>UFW + CrowdSec: Stop Malicious Port Scans (From Fail2ban Pain to a Modern Solution)</title><link>https://jeanphilogong.github.io/jeanblog/linux/linux/ufw-crowdsec-portscan/</link><pubDate>Sat, 22 Nov 2025 12:00:00 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/linux/linux/ufw-crowdsec-portscan/</guid><description>&lt;h1 id="ufw--crowdsec-stop-malicious-port-scans"&gt;UFW + CrowdSec: Stop Malicious Port Scans&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Subtitle / Abstract:&lt;/strong&gt; How do you protect exposed server ports? This guide shows how to move past Fail2ban regex hell and build a stable, automated, intelligent port-scan defense system.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="target-readers"&gt;Target readers&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Developers using FRP or reverse tunnels&lt;/li&gt;
&lt;li&gt;Operators of cloud servers (Tencent, Alibaba, AWS, etc.)&lt;/li&gt;
&lt;li&gt;Linux users who want to stop port scans and SSH brute force&lt;/li&gt;
&lt;li&gt;People using Fail2ban who want a modern alternative&lt;/li&gt;
&lt;li&gt;Anyone improving personal server security&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="background--motivation-why-you-need-port-scan-defense"&gt;Background / Motivation: Why you need port-scan defense&lt;/h2&gt;
&lt;p&gt;When you run FRP (frps + frpc) or expose multiple ports, you will often see:&lt;/p&gt;</description></item><item><title>WireGuard Full Guide: Build a Secure High-Speed Private Network (VPN Tutorial)</title><link>https://jeanphilogong.github.io/jeanblog/linux/linux/wireguard-vpn-neiwang/</link><pubDate>Thu, 20 Nov 2025 07:55:02 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/linux/linux/wireguard-vpn-neiwang/</guid><description>&lt;h1 id="wireguard-full-guide-build-a-secure-high-speed-private-network-vpn-tutorial"&gt;WireGuard Full Guide: Build a Secure High-Speed Private Network (VPN Tutorial)&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Subtitle / Abstract:&lt;/strong&gt;
A beginner-to-intermediate WireGuard VPN guide. Learn to build a fast, secure private network and enforce a zero-exposure model where services are only reachable through VPN.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="target-readers"&gt;Target readers&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;People who want to hide server or PC ports behind a VPN&lt;/li&gt;
&lt;li&gt;Users who want to reduce scanning and brute force risk&lt;/li&gt;
&lt;li&gt;Anyone building a private LAN or remote access to home&lt;/li&gt;
&lt;li&gt;Linux/Windows users, developers, and ops beginners&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="background-and-motivation-why-wireguard"&gt;Background and motivation: Why WireGuard?&lt;/h2&gt;
&lt;p&gt;If you expose ports to the public internet (SSH, databases, admin panels), you will face:&lt;/p&gt;</description></item><item><title>How to Build a Blog System</title><link>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/how-to-build-a-blog-system/</link><pubDate>Fri, 14 Nov 2025 15:04:02 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/how-to-build-a-blog-system/</guid><description>&lt;h1 id="build-a-hugo-blog-with-github-pages-in-10-minutes"&gt;Build a Hugo Blog with GitHub Pages in 10 Minutes&lt;/h1&gt;
&lt;h2 id="subtitle--abstract"&gt;Subtitle / Abstract&lt;/h2&gt;
&lt;p&gt;This guide takes you from zero to a deployed Hugo blog on GitHub Pages with GitHub Actions. It is beginner-friendly and explains the key moving parts.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="target-readers"&gt;Target readers&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Hugo beginners&lt;/li&gt;
&lt;li&gt;Developers who want a quick technical blog&lt;/li&gt;
&lt;li&gt;Users of GitHub Pages and GitHub Actions&lt;/li&gt;
&lt;li&gt;Anyone who wants free static hosting&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="background--motivation"&gt;Background / Motivation&lt;/h2&gt;
&lt;p&gt;Common pain points when publishing a blog:&lt;/p&gt;</description></item><item><title>How to Publish with Hugo</title><link>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/how-to-publish-by-hugo/</link><pubDate>Fri, 14 Nov 2025 15:01:32 +0800</pubDate><guid>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/how-to-publish-by-hugo/</guid><description>&lt;h1 id="how-to-publish-with-hugo-from-markdown-to-online-blog"&gt;How to Publish with Hugo: From Markdown to Online Blog&lt;/h1&gt;
&lt;h2 id="subtitle--abstract"&gt;Subtitle / Abstract&lt;/h2&gt;
&lt;p&gt;This guide explains how to create, manage, and publish Hugo posts: front matter, drafts, images, directory structure, local preview, and deployment.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="target-readers"&gt;Target readers&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Hugo beginners&lt;/li&gt;
&lt;li&gt;Developers building a technical blog with Hugo&lt;/li&gt;
&lt;li&gt;Writers using Markdown + static sites&lt;/li&gt;
&lt;li&gt;Users of PaperMod, DoIt, and similar themes&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="background--motivation"&gt;Background / Motivation&lt;/h2&gt;
&lt;p&gt;After setting up a Hugo site, common questions include:&lt;/p&gt;</description></item><item><title>Write Clear Issues with Templates: From Zero to GitHub Issue Forms</title><link>https://jeanphilogong.github.io/jeanblog/notes/git-notes/write-clear-issues-from-zero-to-template/</link><pubDate>Tue, 11 Nov 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/notes/git-notes/write-clear-issues-from-zero-to-template/</guid><description>&lt;h2 id="title-accurate-and-keyword-rich"&gt;Title (accurate and keyword-rich)&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Write Clear Requirements with Issue Templates: A Complete Guide to GitHub Issue Forms&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="subtitle--abstract"&gt;Subtitle / Abstract&lt;/h2&gt;
&lt;p&gt;This post teaches you how to configure GitHub Issue templates for feature requests and bug reports, including folder structure, YAML forms, Markdown templates, and common pitfalls. It is ideal for teams that want clearer requirements and less back-and-forth.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="target-readers"&gt;Target readers&lt;/h2&gt;
&lt;p&gt;This article is for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Backend/frontend/full-stack engineers who create Issues regularly&lt;/li&gt;
&lt;li&gt;Leads/TLs/architects who want standardized requirement intake&lt;/li&gt;
&lt;li&gt;Mid-level developers familiar with GitHub but new to Issue templates&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Beginners can follow, but basic GitHub knowledge is assumed.&lt;/p&gt;</description></item><item><title>API Standards</title><link>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/api-standards/</link><pubDate>Thu, 06 Nov 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/api-standards/</guid><description>&lt;h1 id="title"&gt;Title&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;How to Write a Qualified API Document: From Swagger to Modern OpenAPI&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="subtitle--abstract"&gt;Subtitle / Abstract&lt;/h2&gt;
&lt;p&gt;Want developers to actually enjoy using your API? This article covers the structure, examples, and best practices of high-quality API documentation based on Swagger/OpenAPI (originally by Tony Tam).&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="target-readers"&gt;Target readers&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Beginners who want a standard API doc structure&lt;/li&gt;
&lt;li&gt;Mid-level developers improving maintainability&lt;/li&gt;
&lt;li&gt;Architects and leads defining API standards&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="background--motivation"&gt;Background / Motivation&lt;/h2&gt;
&lt;p&gt;Common problems in API docs:&lt;/p&gt;</description></item><item><title>Thoughts on AI Systems</title><link>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/thoughts-on-ai-systems/</link><pubDate>Fri, 31 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/thoughts-on-ai-systems/</guid><description>&lt;p&gt;For a system, a single thread should be a single assistant. We should provide each user with one assistant and optimize that assistant.&lt;/p&gt;
&lt;p&gt;Providing many parallel threads per user is too expensive and unnecessary.&lt;/p&gt;</description></item><item><title>How to Set Up Gitea</title><link>https://jeanphilogong.github.io/jeanblog/notes/git-notes/configure-gitea/</link><pubDate>Tue, 28 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/notes/git-notes/configure-gitea/</guid><description>&lt;h1 id="run-gitea-locally-your-private-github-with-existing-repo-import"&gt;Run Gitea Locally: Your Private GitHub (with Existing Repo Import)&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Subtitle / Abstract:&lt;/strong&gt;
This guide walks you through installing the lightweight Git server Gitea on your local machine. No root required, no system pollution. Manage, browse, and push projects like GitHub, and import existing repos.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Target readers:&lt;/strong&gt;
Personal developers, indie engineers, and small team leads with basic Git knowledge.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="background--motivation"&gt;Background / Motivation&lt;/h2&gt;
&lt;p&gt;Many developers want:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;to host code inside a company or LAN&lt;/li&gt;
&lt;li&gt;to avoid cloud platforms (GitHub/Gitee)&lt;/li&gt;
&lt;li&gt;to have a web UI, pull requests, and code browsing&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;GitLab is heavy (often multiple GB of RAM). Gitea is:&lt;/p&gt;</description></item><item><title>Conventional Commits: Make Team Collaboration and Automation Efficient</title><link>https://jeanphilogong.github.io/jeanblog/notes/git-notes/git-commit-conventions-team-efficiency/</link><pubDate>Sat, 25 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/notes/git-notes/git-commit-conventions-team-efficiency/</guid><description>&lt;h3 id="title"&gt;Title&lt;/h3&gt;
&lt;p&gt;From &lt;code&gt;feat&lt;/code&gt; to &lt;code&gt;fix&lt;/code&gt;: master Git commit conventions for collaboration and automation&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id="subtitle--abstract"&gt;Subtitle / Abstract&lt;/h3&gt;
&lt;p&gt;A practical guide to Conventional Commits. Learn commit types (&lt;code&gt;feat:&lt;/code&gt;, &lt;code&gt;fix:&lt;/code&gt;), write clean messages, and enable automatic changelogs and releases.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id="target-readers"&gt;Target readers&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Beginners&lt;/strong&gt;: new to Git, want better commit habits.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mid-level devs&lt;/strong&gt;: want commits friendly to team and CI.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Leads/architects&lt;/strong&gt;: want a consistent team standard.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id="background--motivation"&gt;Background / Motivation&lt;/h3&gt;
&lt;p&gt;Most commit messages look like:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;ldquo;update code&amp;rdquo;
&amp;ldquo;fix bug&amp;rdquo;
&amp;ldquo;some changes&amp;rdquo;&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>How to Write a Perfect Machine Learning Document</title><link>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/how-to-write-a-perfect-ml-document/</link><pubDate>Fri, 24 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/how-to-write-a-perfect-ml-document/</guid><description>&lt;h1 id="bengio-style-ml-task-specification-from-research-to-engineering"&gt;Bengio-style ML Task Specification: From Research to Engineering&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Subtitle:&lt;/strong&gt;
How to write a reproducible, explainable, and comparable fine-tuning task document based on Yoshua Bengio&amp;rsquo;s methodology.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reading time:&lt;/strong&gt; 10 minutes
&lt;strong&gt;Tags:&lt;/strong&gt; ML documentation, fine-tuning, technical standards, deep learning practice
&lt;strong&gt;Audience:&lt;/strong&gt; mid to senior ML engineers, researchers, technical writers&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="1-why-do-we-need-this-document"&gt;1. Why do we need this document?&lt;/h2&gt;
&lt;p&gt;In ML projects, teams often run fine-tuning experiments. Months later, nobody can reproduce results or explain why a learning rate or LoRA layer was chosen.&lt;/p&gt;</description></item><item><title>Ping Works but SSH Fails: A Real Case of SSH vs VNC</title><link>https://jeanphilogong.github.io/jeanblog/linux/linux/ping-works-ssh-fails-fake-ssh-true-vnc/</link><pubDate>Fri, 24 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/linux/linux/ping-works-ssh-fails-fake-ssh-true-vnc/</guid><description>&lt;h1 id="ping-works-but-ssh-fails-a-real-case-of-ssh-vs-vnc"&gt;Ping Works but SSH Fails: A Real Case of SSH vs VNC&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Subtitle:&lt;/strong&gt; From connection refusal to protocol identification: understand TCP, SSH, and VNC
&lt;strong&gt;Reading time:&lt;/strong&gt; 7 minutes
&lt;strong&gt;Tags:&lt;/strong&gt; network troubleshooting, SSH, VNC, Linux, remote access
&lt;strong&gt;SEO keywords:&lt;/strong&gt; SSH connection failed, kex_exchange_identification, VNC port 5905, RFB 003.008, SSH vs VNC&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id="target-readers"&gt;Target readers&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Linux users, developers, and server admins&lt;/li&gt;
&lt;li&gt;Engineers learning systematic network troubleshooting&lt;/li&gt;
&lt;li&gt;Readers interested in SSH/VNC protocol behavior&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="background-and-motivation"&gt;Background and motivation&lt;/h2&gt;
&lt;p&gt;Have you seen this?&lt;/p&gt;</description></item><item><title>Run SSH Without sudo: User-Level sshd on Linux</title><link>https://jeanphilogong.github.io/jeanblog/linux/linux/enable-ssh-without-sudo/</link><pubDate>Fri, 24 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/linux/linux/enable-ssh-without-sudo/</guid><description>&lt;p&gt;Below is a full draft based on your SSH startup and debugging process. It is ready for publication on a technical blog.&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="run-ssh-without-sudo-on-linux-user-level-sshd-guide"&gt;Run SSH Without sudo on Linux (User-Level sshd Guide)&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Subtitle / Abstract:&lt;/strong&gt;
When you have no root access in a lab or restricted server environment, how do you start SSH and access your account remotely? This guide shows how to run &lt;code&gt;sshd&lt;/code&gt; in your user directory, enable key login, and connect remotely.&lt;/p&gt;</description></item><item><title>Run sshd Without sudo: Troubleshooting and Persistent User-Level SSH</title><link>https://jeanphilogong.github.io/jeanblog/linux/linux/fix-sshsystem-process-start-failure/</link><pubDate>Fri, 24 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/linux/linux/fix-sshsystem-process-start-failure/</guid><description>&lt;p&gt;&lt;strong&gt;Title:&lt;/strong&gt;
Run sshd Without sudo: Troubleshooting, nohup, and systemd (User-Level SSH)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Subtitle / Abstract:&lt;/strong&gt;
How to run OpenSSH as a normal user, solve common errors like &amp;ldquo;connection refused&amp;rdquo;, &amp;ldquo;password auth failed&amp;rdquo;, and &lt;code&gt;start-limit-hit&lt;/code&gt;, and keep sshd alive using nohup or systemd.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Target readers:&lt;/strong&gt;
Intermediate Linux users, researchers on shared servers, and anyone who needs SSH without root.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="1-background--motivation"&gt;1. Background / Motivation&lt;/h2&gt;
&lt;p&gt;In some lab or shared environments, regular users do not have sudo. The default sshd service cannot be started. If you need to:&lt;/p&gt;</description></item><item><title>Auto-start frp on Ubuntu with systemd</title><link>https://jeanphilogong.github.io/jeanblog/linux/linux/frp-auto-start-on-ubuntu/</link><pubDate>Thu, 23 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/linux/linux/frp-auto-start-on-ubuntu/</guid><description>&lt;h1 id="auto-start-frp-on-ubuntu-a-complete-guide"&gt;Auto-start frp on Ubuntu: A Complete Guide&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;Subtitle / Abstract&lt;/strong&gt;
Use systemd to run frp (Fast Reverse Proxy) as a managed service for stable, secure, and monitored auto-start on boot.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reading time&lt;/strong&gt;: 8 minutes
&lt;strong&gt;Tags&lt;/strong&gt;: frp, intranet tunneling, systemd, auto-start, Linux, Ubuntu
&lt;strong&gt;SEO keywords&lt;/strong&gt;: frp auto start, Ubuntu frp config, frpc systemd, frps service, intranet tunneling
&lt;strong&gt;Meta description&lt;/strong&gt;: Step-by-step systemd setup for frp (frpc/frps) with config templates and troubleshooting.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="target-readers"&gt;Target readers&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Developers deploying frps on cloud servers&lt;/li&gt;
&lt;li&gt;Intermediate Linux users building stable home/office tunnels&lt;/li&gt;
&lt;li&gt;DevOps and self-hosting enthusiasts&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="background-and-motivation"&gt;Background and motivation&lt;/h2&gt;
&lt;p&gt;Many developers use &lt;strong&gt;frp&lt;/strong&gt; to expose internal services (SSH, web, NAS) to the internet. The problem is that running &lt;code&gt;./frpc -c frpc.ini&lt;/code&gt; manually is inconvenient and unreliable after reboot.&lt;/p&gt;</description></item><item><title>Expose WSL2 Services to the LAN via Windows Port Forwarding</title><link>https://jeanphilogong.github.io/jeanblog/linux/linux/wsl-intranet-not-shared-with-windows/</link><pubDate>Wed, 22 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/linux/linux/wsl-intranet-not-shared-with-windows/</guid><description>&lt;h1 id="windows--wsl2-port-forwarding-guide-access-flask-5000"&gt;Windows + WSL2 Port Forwarding Guide (Access Flask 5000)&lt;/h1&gt;
&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;You are using &lt;strong&gt;WSL2&lt;/strong&gt; (Ubuntu or another Linux distro)&lt;/li&gt;
&lt;li&gt;The Windows host can access the LAN (Wi-Fi or Ethernet)&lt;/li&gt;
&lt;li&gt;A Flask service is running inside WSL2 and listening on:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;app&lt;span style="color:#f92672"&gt;.&lt;/span&gt;run(host&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#e6db74"&gt;&amp;#34;0.0.0.0&amp;#34;&lt;/span&gt;, port&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;5000&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;host=&amp;quot;0.0.0.0&amp;quot;&lt;/code&gt; is required; otherwise external access will fail.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id="step-1-check-the-wsl2-ip"&gt;Step 1: Check the WSL2 IP&lt;/h2&gt;
&lt;p&gt;In WSL2:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ip addr show eth0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see something like:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;inet 172.26.209.37/20
&lt;/code&gt;&lt;/pre&gt;&lt;blockquote&gt;
&lt;p&gt;Record the IP after &lt;code&gt;inet&lt;/code&gt; (here: &lt;code&gt;172.26.209.37&lt;/code&gt;). This is the WSL2 internal IP.&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>How to Use wrk for Load Testing</title><link>https://jeanphilogong.github.io/jeanblog/linux/linux/wrk-load-testing-guide/</link><pubDate>Wed, 22 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/linux/linux/wrk-load-testing-guide/</guid><description>&lt;h1 id="load-testing-apis-with-wrk-detailed-guide"&gt;Load Testing APIs with wrk (Detailed Guide)&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;This article explains how to use &lt;code&gt;wrk&lt;/code&gt; on Ubuntu to stress-test backend APIs (Flask, FastAPI, Spring Boot, etc.) and interpret the results.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id="1-what-is-wrk"&gt;1. What is wrk?&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/wg/wrk"&gt;&lt;code&gt;wrk&lt;/code&gt;&lt;/a&gt; is a modern, high-performance HTTP benchmarking tool written in C. Key features:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;High concurrency&lt;/strong&gt;: thousands of concurrent connections&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multi-threaded&lt;/strong&gt;: uses multiple CPU cores&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lua scripting&lt;/strong&gt;: for custom headers, bodies, tokens&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Faster than Apache Benchmark (ab)&lt;/strong&gt;: lighter and more stable&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="2-install-wrk"&gt;2. Install wrk&lt;/h2&gt;
&lt;p&gt;On Ubuntu/Debian:&lt;/p&gt;</description></item><item><title>LAN Git Bare on WSL2</title><link>https://jeanphilogong.github.io/jeanblog/notes/git-notes/lan-git-bare-repo/</link><pubDate>Wed, 22 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/notes/git-notes/lan-git-bare-repo/</guid><description>&lt;h1 id="access-a-git-bare-repo-on-windows-wsl2-from-the-lan"&gt;Access a Git Bare Repo on Windows WSL2 from the LAN&lt;/h1&gt;
&lt;p&gt;In development, you often need to share Git repositories across multiple machines. If you use WSL2 on Windows and want other LAN machines to access a Git bare repo inside WSL2, this guide walks you through the setup.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="1-create-a-git-bare-repo-in-wsl2"&gt;1. Create a Git bare repo in WSL2&lt;/h2&gt;
&lt;p&gt;In WSL2, go to the target directory:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;git init --bare my_project.git
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;my_project.git&lt;/code&gt; is a bare repo with no working tree, only Git data.&lt;/li&gt;
&lt;li&gt;A bare repo behaves like a remote and can be cloned and pushed.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="2-enable-ssh-in-wsl2"&gt;2. Enable SSH in WSL2&lt;/h2&gt;
&lt;p&gt;Other machines will access via SSH.&lt;/p&gt;</description></item><item><title>Git Branch Workflow for Small Teams</title><link>https://jeanphilogong.github.io/jeanblog/notes/git-notes/git-branching-workflow/</link><pubDate>Mon, 20 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/notes/git-notes/git-branching-workflow/</guid><description>&lt;h1 id="simplified-git-branch-workflow-solo--small-team"&gt;Simplified Git Branch Workflow (Solo / Small Team)&lt;/h1&gt;
&lt;p&gt;This workflow is a simplified version of Git Flow. It is suitable for personal projects or small teams: structured but not heavy.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="1-main-branch-long-lived"&gt;1. Main branch (long-lived)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;main&lt;/code&gt;&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Always stable and release-ready&lt;/li&gt;
&lt;li&gt;Production deployments come from here&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;For small teams, &lt;code&gt;main&lt;/code&gt; is usually enough; no need for &lt;code&gt;develop&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id="2-feature-development-feature-branch"&gt;2. Feature development (feature branch)&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Naming: &lt;code&gt;feature/&amp;lt;feature-name&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Purpose: build new features, then merge back to &lt;code&gt;main&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Examples:&lt;/p&gt;</description></item><item><title>Use a Local Git Bare Repo to Separate Dev and Test Environments</title><link>https://jeanphilogong.github.io/jeanblog/notes/git-notes/git-bare-repo-dev-test-isolation/</link><pubDate>Mon, 20 Oct 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/notes/git-notes/git-bare-repo-dev-test-isolation/</guid><description>&lt;h1 id="use-a-local-git-bare-repo-to-separate-dev-and-test-environments"&gt;Use a Local Git Bare Repo to Separate Dev and Test Environments&lt;/h1&gt;
&lt;p&gt;In full-stack work, a common problem is &lt;strong&gt;how to isolate dev and test environments&lt;/strong&gt;. Many people host on GitHub or GitLab, but private projects may not be suitable for public hosting.&lt;/p&gt;
&lt;p&gt;Git is distributed. You can set up a &lt;strong&gt;local bare repo&lt;/strong&gt; as a remote to move code from &lt;strong&gt;dev -&amp;gt; test&lt;/strong&gt; in one machine.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="what-is-a-bare-repository"&gt;What is a bare repository?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A normal repo (&lt;code&gt;git init&lt;/code&gt;) has a &lt;strong&gt;working tree + .git metadata&lt;/strong&gt; and can be edited directly.&lt;/li&gt;
&lt;li&gt;A bare repo (&lt;code&gt;git init --bare&lt;/code&gt;) has only Git data, no working tree. It is usually used as a &lt;strong&gt;remote&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In short:&lt;/p&gt;</description></item><item><title>How to Use and Configure a TypeScript Environment</title><link>https://jeanphilogong.github.io/jeanblog/dev/frontend/typescript-setup-guide/</link><pubDate>Thu, 28 Aug 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/dev/frontend/typescript-setup-guide/</guid><description>&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;For TypeScript files with the &lt;code&gt;.ts&lt;/code&gt; extension, we cannot run them directly. We need to transpile TypeScript to JavaScript and then run the JavaScript output.&lt;/p&gt;
&lt;p&gt;There are two common approaches: upload &lt;code&gt;.ts&lt;/code&gt; to the server and compile via CI, or transpile locally and upload the &lt;code&gt;.js&lt;/code&gt; build to production. If you want to run and test locally during development, you can use &lt;code&gt;ts-node&lt;/code&gt;, but the project still needs a build step for production.&lt;/p&gt;</description></item><item><title>A New Frontend Idea for AI Assistants</title><link>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/ai-assistant-frontend-rebuild-ideas/</link><pubDate>Wed, 27 Aug 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/ai-assistant-frontend-rebuild-ideas/</guid><description>&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;I want to build an AI system that supports tree-shaped or graph-shaped Q&amp;amp;A, instead of a traditional single-thread chat flow.&lt;/p&gt;
&lt;h1 id="exploration"&gt;Exploration&lt;/h1&gt;
&lt;h2 id="open-source-framework-research"&gt;Open-source framework research&lt;/h2&gt;
&lt;h3 id="flowise"&gt;flowise&lt;/h3&gt;</description></item><item><title>How to Create and Edit Mermaid Diagrams</title><link>https://jeanphilogong.github.io/jeanblog/linux/linux/create-and-edit-mermaid-diagrams/</link><pubDate>Tue, 26 Aug 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/linux/linux/create-and-edit-mermaid-diagrams/</guid><description>&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;Mermaid is a framework for creating diagrams using code. This post shows how to install the tooling on your server and render Mermaid code into images.&lt;/p&gt;
&lt;h1 id="steps"&gt;Steps&lt;/h1&gt;
&lt;h2 id="install-the-renderer"&gt;Install the renderer&lt;/h2&gt;
&lt;p&gt;Run:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;npm install -g @mermaid-js/mermaid-cli
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note: the CLI requires npm version &amp;gt;= 20. It is recommended to manage npm versions with nvm.&lt;/p&gt;
&lt;p&gt;If you do not have nvm, install it with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;curl -o https://raw.githubusercontent.com/nvm-sh/nvim/v0.39.4/install.sh | bash
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Restart your shell, then run:&lt;/p&gt;</description></item><item><title>Mastering a Paper</title><link>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/mastering-paper/</link><pubDate>Tue, 26 Aug 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/mastering-paper/</guid><description>&lt;h1 id="how-to-truly-master-a-paper"&gt;How to Truly Master a Paper&lt;/h1&gt;
&lt;h1 id="conclusion"&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;To truly master a paper, reading once is not enough. You need to decompose, verify, and reconstruct it, and then express the key points in your own words or implementation. The goal: explain the core contribution in 5 minutes, derive key formulas by hand, and reproduce a core experiment.&lt;/p&gt;
&lt;h1 id="principles-and-background"&gt;Principles and background&lt;/h1&gt;
&lt;p&gt;A paper is a compressed expression of a problem. It omits background, intuition, failed attempts, and many details. Mastery requires &amp;ldquo;decompressing&amp;rdquo; that information into your own knowledge network: assumptions, derivations, engineering steps, and the limits of the results. Only then can you judge when to use it and when not to.&lt;/p&gt;</description></item><item><title>Reading an NVIDIA Paper on Small Language Models</title><link>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/reading-nvidia-small-models-paper/</link><pubDate>Tue, 26 Aug 2025 00:00:00 +0000</pubDate><guid>https://jeanphilogong.github.io/jeanblog/thoughts/thoughts/reading-nvidia-small-models-paper/</guid><description>&lt;h1 id="what-problem-does-this-paper-solve-and-what-are-the-results"&gt;What problem does this paper solve, and what are the results?&lt;/h1&gt;
&lt;p&gt;We know AI systems are expanding and can solve general tasks. But many AI agent applications today target small tasks. NVIDIA argues that small language models (SLMs) are capable, more suitable, and cheaper, and should be a main direction for future agents.&lt;/p&gt;
&lt;p&gt;The paper discusses:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;What tasks current SLMs can handle&lt;/li&gt;
&lt;li&gt;Where general language ability matters&lt;/li&gt;
&lt;li&gt;The limits of SLMs as agents&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Conclusion: moving from LLMs to SLMs has advantages in both capability and cost.&lt;/p&gt;</description></item></channel></rss>