<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sliding-Window on Algorithms in 60 Days</title><link>https://algorithmsin60days.com/tags/sliding-window/</link><description>Recent content in Sliding-Window on Algorithms in 60 Days</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 05 Jul 2026 11:00:00 +0500</lastBuildDate><atom:link href="https://algorithmsin60days.com/tags/sliding-window/index.xml" rel="self" type="application/rss+xml"/><item><title>The Sliding Window Technique: Explained with 5 Interview Problems</title><link>https://algorithmsin60days.com/blog/sliding-window-technique-explained/</link><pubDate>Sun, 05 Jul 2026 11:00:00 +0500</pubDate><guid>https://algorithmsin60days.com/blog/sliding-window-technique-explained/</guid><description>&lt;p&gt;&amp;ldquo;Longest substring without repeating characters.&amp;rdquo; &amp;ldquo;Maximum sum subarray of size k.&amp;rdquo; &amp;ldquo;Smallest window containing all characters of t.&amp;rdquo; These problems appear in FAANG interview loops constantly, and they share a shape: &lt;strong&gt;find the best contiguous chunk of an array or string.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The naive approach enumerates every subarray (O(n²) of them) and evaluates each one, often for O(n³) total. The sliding window technique solves the same problems in O(n) with one idea: &lt;strong&gt;when the window moves, don&amp;rsquo;t recompute its contents from scratch: update them incrementally.&lt;/strong&gt; A window sliding one step right adds one element and (maybe) drops one element. Everything else it contains is unchanged, so recomputing it is pure waste.&lt;/p&gt;</description></item></channel></rss>