<?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>Detect Squares on Dmytro&#39;s Blog</title>
    <link>https://dmytros.blog/tags/detect-squares/</link>
    <description>Recent content in Detect Squares on Dmytro&#39;s Blog</description>
    <image>
      <title>Dmytro&#39;s Blog</title>
      <url>https://dmytros.blog/images/papermod-cover.png</url>
      <link>https://dmytros.blog/images/papermod-cover.png</link>
    </image>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 23 Jun 2026 08:04:51 +0300</lastBuildDate>
    <atom:link href="https://dmytros.blog/tags/detect-squares/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>LeetCode - 150 - Detect Squares</title>
      <link>https://dmytros.blog/posts/leetcode-150-detect-squares/</link>
      <pubDate>Tue, 23 Jun 2026 08:04:51 +0300</pubDate>
      <guid>https://dmytros.blog/posts/leetcode-150-detect-squares/</guid>
      <description>&lt;h3 id=&#34;the-problem&#34;&gt;The problem&lt;/h3&gt;
&lt;p&gt;You are given a stream of points on the X-Y plane. Design an algorithm that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Adds&lt;/strong&gt; new points from the stream into a data structure. &lt;strong&gt;Duplicate&lt;/strong&gt; points are allowed and should be treated as different points.&lt;/li&gt;
&lt;li&gt;Given a query point, &lt;strong&gt;counts&lt;/strong&gt; the number of ways to choose three points from the data structure such that the three points and the query point form an &lt;strong&gt;axis-aligned square&lt;/strong&gt; with &lt;strong&gt;positive area&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;An &lt;strong&gt;axis-aligned square&lt;/strong&gt; is a square whose edges are all the same length and are either parallel or perpendicular to the x-axis and y-axis.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
