<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Leetcode on Saltfish's Blog</title><link>https://blog.saltfish.org/categories/leetcode/</link><description>Recent content in Leetcode on Saltfish's Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 20 Feb 2026 16:35:07 -0500</lastBuildDate><atom:link href="https://blog.saltfish.org/categories/leetcode/index.xml" rel="self" type="application/rss+xml"/><item><title>The Number of Good Subsets</title><link>https://blog.saltfish.org/posts/the-number-of-good-subsets/</link><pubDate>Fri, 20 Feb 2026 16:22:49 -0500</pubDate><guid>https://blog.saltfish.org/posts/the-number-of-good-subsets/</guid><description>&lt;p>&lt;a href="https://leetcode.com/problems/the-number-of-good-subsets/description/" target="_blank" rel="noreferrer">Link&lt;/a>&lt;/p>
&lt;h2 id="problem" class="relative group">Problem &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#problem" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>You are given an integer array nums. We call a subset of nums good if its product can be represented as a product of one or more distinct prime numbers.&lt;/p>
&lt;p>For example, if &lt;code>nums = [1, 2, 3, 4]&lt;/code>:&lt;br>
&lt;code>[2, 3]&lt;/code>, &lt;code>[1, 2, 3]&lt;/code>, and &lt;code>[1, 3]&lt;/code> are good subsets with products &lt;code>6 = 2*3&lt;/code>, &lt;code>6 = 2*3&lt;/code>, and &lt;code>3 = 3&lt;/code> respectively.&lt;br>
&lt;code>[1, 4]&lt;/code> and &lt;code>[4]&lt;/code> are not good subsets with products &lt;code>4 = 2*2&lt;/code> and &lt;code>4 = 2*2&lt;/code> respectively.&lt;br>
Return the number of different good subsets in nums modulo 1e9 + 7.&lt;/p></description></item><item><title>Merge Two Binary Tree</title><link>https://blog.saltfish.org/posts/merge-two-binary-tree/</link><pubDate>Sat, 14 Feb 2026 19:04:39 -0500</pubDate><guid>https://blog.saltfish.org/posts/merge-two-binary-tree/</guid><description>&lt;p>Link &lt;a href="https://leetcode.com/problems/merge-two-binary-trees/description/" target="_blank" rel="noreferrer">Merge Two Binary Trees&lt;/a>&lt;/p>
&lt;h2 id="problem" class="relative group">Problem &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#problem" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>You are given two binary trees root1 and root2.&lt;/p>
&lt;p>Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge the two trees into a new binary tree. The merge rule is that if two nodes overlap, then sum node values up as the new value of the merged node. Otherwise, the NOT null node will be used as the node of the new tree.&lt;/p></description></item><item><title>Stone Game</title><link>https://blog.saltfish.org/posts/stone-game/</link><pubDate>Fri, 13 Feb 2026 19:46:40 -0500</pubDate><guid>https://blog.saltfish.org/posts/stone-game/</guid><description>&lt;p>Link: &lt;a href="https://leetcode.com/problems/stone-game/" target="_blank" rel="noreferrer">Stone Game&lt;/a>&lt;/p>
&lt;h2 id="problem" class="relative group">Problem &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#problem" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>Alice and Bob play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of stones &lt;code>piles[i]&lt;/code>.&lt;/p>
&lt;p>The objective of the game is to end with the most stones. The total number of stones across all the piles is odd, so there are no ties.&lt;/p></description></item><item><title>Split a String in Balanced Strings</title><link>https://blog.saltfish.org/posts/split_a_string_in_balanced_strings/</link><pubDate>Thu, 12 Feb 2026 18:06:47 -0500</pubDate><guid>https://blog.saltfish.org/posts/split_a_string_in_balanced_strings/</guid><description>&lt;p>Problem Link: &lt;a href="https://leetcode.com/problems/split-a-string-in-balanced-strings" target="_blank" rel="noreferrer">Split a String in Balanced Strings&lt;/a>&lt;/p>
&lt;h2 id="problem" class="relative group">Problem &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#problem" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>Balanced strings are those that have an equal quantity of &amp;lsquo;L&amp;rsquo; and &amp;lsquo;R&amp;rsquo; characters.&lt;/p>
&lt;p>Given a balanced string &lt;code>s&lt;/code>, split it into some number of substrings such that:&lt;/p>
&lt;p>Each substring is balanced.
Return the maximum number of balanced strings you can obtain.&lt;/p></description></item><item><title>Stone Game II</title><link>https://blog.saltfish.org/posts/stone-game-ii/</link><pubDate>Wed, 11 Feb 2026 16:57:25 -0500</pubDate><guid>https://blog.saltfish.org/posts/stone-game-ii/</guid><description>&lt;h1 id="stone-game-ii" class="relative group">Stone Game II &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#stone-game-ii" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h1>&lt;p>Link: &lt;a href="https://leetcode.com/problems/stone-game-ii/" target="_blank" rel="noreferrer">Stone Game II&lt;/a>&lt;/p>
&lt;h2 id="problem" class="relative group">Problem &lt;span class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100">&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#problem" aria-label="Anchor">#&lt;/a>&lt;/span>&lt;/h2>&lt;p>Alice and Bob continue their games with piles of stones. There are a number of piles arranged in a row, and each pile has a positive integer number of stones piles[i]. The objective of the game is to end with the most stones.&lt;/p></description></item></channel></rss>