<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>panda_noir</author_name>
  <author_url>https://blog.hatena.ne.jp/panda_noir/</author_url>
  <blog_title>Panda Noir</blog_title>
  <blog_url>https://www.pandanoir.info/</blog_url>
  <categories>
    <anon>JavaScript</anon>
  </categories>
  <description>const arr = [5, 2, 7, 8, 1, 4]; arr.sort((a, b) =&gt; (b % 2) - (a % 2)); console.log(arr) // [5, 7, 1, 2, 8, 4] 実質的にpartitionになっている。あたりまえ体操。 でも、単にpartitionしたいだけならO(N)でできるのであんまり意味はない。 function partition&lt;T&gt;( arr: T[], cond: (x: T) =&gt; boolean, ): [T[], T[]] { const t: T[] = [], f: T[] = []; for (const x …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.pandanoir.info%2Fentry%2F2026%2F05%2F17%2F092149&quot; title=&quot;安定ソートはフィルタリングである - Panda Noir&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2026-05-17 09:21:49</published>
  <title>安定ソートはフィルタリングである</title>
  <type>rich</type>
  <url>https://www.pandanoir.info/entry/2026/05/17/092149</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
