<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Sweepline on icyveins7's blog</title><link>https://icyveins7.github.io/tags/sweepline/</link><description>Recent content in Sweepline on icyveins7's blog</description><generator>Hugo</generator><language>en-us</language><copyright>This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.</copyright><lastBuildDate>Wed, 10 Sep 2025 20:00:00 +0800</lastBuildDate><atom:link href="https://icyveins7.github.io/tags/sweepline/index.xml" rel="self" type="application/rss+xml"/><item><title>Stumbling into a sweep line algorithm's edge case</title><link>https://icyveins7.github.io/posts/2025/09/stumbling-into-a-sweep-line-algorithms-edge-case/</link><pubDate>Wed, 10 Sep 2025 20:00:00 +0800</pubDate><guid>https://icyveins7.github.io/posts/2025/09/stumbling-into-a-sweep-line-algorithms-edge-case/</guid><description>&lt;blockquote&gt;&#10;&lt;p&gt;Mistakes that you should learn from, lesson 1..&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;I recently wrote some code for interval merging. Every leetcoder can probably recite 15 algorithms to do this in their sleep, but I figured it out myself in this case, and in the process fell into an edge case.&lt;/p&gt;&#10;&lt;p&gt;Here&amp;rsquo;s to writing down your mistakes.&lt;/p&gt;&#10;&lt;h1 id="interval-merging"&gt;Interval merging&lt;/h1&gt;&#10;&lt;p&gt;The generic interval merging problem provides you with a list of start/stop pairs which denote individual intervals. Each interval is then to be merged with any other overlapping intervals; an overlap is defined by at least 1 element being shared between 2 intervals.&lt;/p&gt;</description></item></channel></rss>