<?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>Posts on Robin Yang</title>
    <link>https://yrbing.github.io/posts/</link>
    <description>Recent content in Posts on Robin Yang</description>
    <image>
      <title>Robin Yang</title>
      <url>https://yrbing.github.io/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</url>
      <link>https://yrbing.github.io/%3Clink%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E</link>
    </image>
    <generator>Hugo -- 0.152.2</generator>
    <language>en-us</language>
    <lastBuildDate>Fri, 16 Jan 2026 17:49:32 +0800</lastBuildDate>
    <atom:link href="https://yrbing.github.io/posts/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>The Core Patterns of Variable-Length Sliding Window: Longest &amp; Shortest Subarrays</title>
      <link>https://yrbing.github.io/posts/variable-length-sliding-window/</link>
      <pubDate>Fri, 16 Jan 2026 17:49:32 +0800</pubDate>
      <guid>https://yrbing.github.io/posts/variable-length-sliding-window/</guid>
      <description>&lt;p&gt;Previously, we explored the fixed-length sliding window technique, which typically involves sliding a window of &lt;strong&gt;&lt;em&gt;constant size&lt;/em&gt;&lt;/strong&gt; by one element at a time. For a detailed explanation, refer to the article &amp;mdash;&amp;mdash; 📝&lt;a href=&#34;https://yrbing.github.io/posts/fixed-length-sliding-window&#34;&gt;How to Solve Fixed-Length Sliding Window Problems&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now, we encounter a new class of problems that also appear solvable with a sliding window approach, but with a crucial difference: &lt;strong&gt;&lt;em&gt;the window size is variable&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;h2 id=&#34;find-the-longest-subarray&#34;&gt;Find the Longest Subarray&lt;/h2&gt;
&lt;p&gt;Given a string &lt;code&gt;s&lt;/code&gt;, find the length of the &lt;strong&gt;&lt;em&gt;longest substring&lt;/em&gt;&lt;/strong&gt; without duplicate characters.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Integrate Swiper.js with Hugo Shortcodes</title>
      <link>https://yrbing.github.io/posts/add-swiper-to-hugo-shortcodes/</link>
      <pubDate>Sat, 10 Jan 2026 15:22:57 +0800</pubDate>
      <guid>https://yrbing.github.io/posts/add-swiper-to-hugo-shortcodes/</guid>
      <description>&lt;p&gt;I’d like to add an image carousel / slider to my article. After some research, I found three common approaches:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Hardcoding HTML directly into Markdown (tedious and hard to maintain).&lt;/li&gt;
&lt;li&gt;Using Hugo Modules (powerful but sometimes overkill for a simple slider).&lt;/li&gt;
&lt;li&gt;Creating a Custom Shortcode (the perfect balance of flexibility and performance).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In this post, I’ll show you how I built a robust, reusable Swiper component using the Shortcode approach. This method keeps your Markdown clean while ensuring your site stays fast.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Reverse Thinking With Fixed-Length Sliding Window</title>
      <link>https://yrbing.github.io/posts/backward-thinking-with-sliding-window/</link>
      <pubDate>Thu, 01 Jan 2026 17:22:51 +0800</pubDate>
      <guid>https://yrbing.github.io/posts/backward-thinking-with-sliding-window/</guid>
      <description>&lt;p&gt;We previously learned about the fixed-length sliding window technique, which typically involves sliding one element at a time. For a detailed explanation, refer to the article &amp;mdash;&amp;mdash; 📝&lt;a href=&#34;https://yrbing.github.io/posts/fixed-length-sliding-window&#34;&gt;How to Solve Fixed-Length Sliding Window Problems&lt;/a&gt;. Now, we encounter a new problem that also appears solvable with a sliding window, but with a slight twist🔗.&lt;/p&gt;
&lt;h2 id=&#34;a-tricky-problem&#34;&gt;A Tricky Problem&lt;/h2&gt;
&lt;p&gt;There are several cards arranged in a row, and each card has an associated number of points. The points are given in the integer array &lt;code&gt;cardPoints&lt;/code&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Math Typesetting in Hugo</title>
      <link>https://yrbing.github.io/posts/math-typesetting-in-hugo/</link>
      <pubDate>Mon, 29 Dec 2025 14:45:52 +0800</pubDate>
      <guid>https://yrbing.github.io/posts/math-typesetting-in-hugo/</guid>
      <description>&lt;p&gt;Hugo supports LaTeX math rendering via third-party JavaScript libraries, with &lt;a href=&#34;https://www.mathjax.org/&#34;&gt;MathJax&lt;/a&gt; and &lt;a href=&#34;https://katex.org/&#34;&gt;KaTeX&lt;/a&gt; being the two most popular options. This guide uses &lt;strong&gt;KaTeX&lt;/strong&gt; for its speed and lightweight design.&lt;/p&gt;
&lt;p&gt;The implementation is simple: include the library in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; section. However, to optimize performance, we&amp;rsquo;ll load it conditionally—only on pages that actually need it.&lt;/p&gt;
&lt;p&gt;$$
\color{#c7c3c3} {
\begin{pmatrix}
1 &amp;amp; 2 \\
3 &amp;amp; 4
\end{pmatrix}
}
$$&lt;/p&gt;
&lt;h3 id=&#34;1-create-a-partial-for-katex-assets&#34;&gt;1. Create a Partial for KaTeX Assets&lt;/h3&gt;
&lt;p&gt;Create a new file at &lt;code&gt;/layouts/partials/helpers/math.html&lt;/code&gt; and add the following:&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to Solve Fixed-Length Sliding Window Problems!</title>
      <link>https://yrbing.github.io/posts/fixed-length-sliding-window/</link>
      <pubDate>Wed, 24 Dec 2025 16:55:18 +0800</pubDate>
      <guid>https://yrbing.github.io/posts/fixed-length-sliding-window/</guid>
      <description>&lt;h2 id=&#34;one-classic-problem&#34;&gt;One Classic Problem&lt;/h2&gt;
&lt;p&gt;Given an integer array &lt;code&gt;nums&lt;/code&gt; consisting of &lt;code&gt;n&lt;/code&gt; elements, and an integer &lt;code&gt;k&lt;/code&gt;, find the &lt;strong&gt;maximum sum&lt;/strong&gt; of any contiguous subarray of size &lt;code&gt;k&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Input: arr = [2, 1, 5, 1, 3, 2], k = 3&lt;/p&gt;
&lt;p&gt;Output: 9&lt;/p&gt;
&lt;p&gt;Explanation: Subarray [5, 1, 3] has the maximum sum 9&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Constraints:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;$n == nums.length$&lt;/li&gt;
&lt;li&gt;$1 &amp;lt;= k &amp;lt;= n &amp;lt;= 10^5$&lt;/li&gt;
&lt;li&gt;$-10^4 &amp;lt;= nums[i] &amp;lt;= 10^4$&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;brute-force-approach&#34;&gt;Brute Force Approach&lt;/h3&gt;
&lt;p&gt;The simplest solution checks each subarray independently:
&lt;img loading=&#34;lazy&#34; src=&#34;https://yrbing.github.io/images/sliding-window-brute-force.png&#34;&gt;&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
