<?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>Deduplication on Jeanphilo Blog</title><link>https://shio-chan-dev.github.io/jeanblog/tags/deduplication/</link><description>Recent content in Deduplication on Jeanphilo Blog</description><generator>Hugo -- 0.161.1</generator><language>en-us</language><lastBuildDate>Sun, 03 May 2026 14:25:07 +0800</lastBuildDate><atom:link href="https://shio-chan-dev.github.io/jeanblog/tags/deduplication/index.xml" rel="self" type="application/rss+xml"/><item><title>LeetCode 90: Subsets II, Derive Layer-Level Deduplication</title><link>https://shio-chan-dev.github.io/jeanblog/alg/leetcode/hot100/backtracking/90-subsets-ii/</link><pubDate>Sun, 03 May 2026 14:25:07 +0800</pubDate><guid>https://shio-chan-dev.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></channel></rss>