{"author_name":"panda_noir","version":"1.0","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/panda_noir/","description":"const arr = [5, 2, 7, 8, 1, 4]; arr.sort((a, b) => (b % 2) - (a % 2)); console.log(arr) // [5, 7, 1, 2, 8, 4] \u5b9f\u8cea\u7684\u306bpartition\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u3042\u305f\u308a\u307e\u3048\u4f53\u64cd\u3002 \u3067\u3082\u3001\u5358\u306bpartition\u3057\u305f\u3044\u3060\u3051\u306a\u3089O(N)\u3067\u3067\u304d\u308b\u306e\u3067\u3042\u3093\u307e\u308a\u610f\u5473\u306f\u306a\u3044\u3002 function partition<T>( arr: T[], cond: (x: T) => boolean, ): [T[], T[]] { const t: T[] = [], f: T[] = []; for (const x \u2026","url":"https://www.pandanoir.info/entry/2026/05/17/092149","blog_title":"Panda Noir","width":"100%","image_url":null,"title":"\u5b89\u5b9a\u30bd\u30fc\u30c8\u306f\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3067\u3042\u308b","blog_url":"https://www.pandanoir.info/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.pandanoir.info%2Fentry%2F2026%2F05%2F17%2F092149\" title=\"\u5b89\u5b9a\u30bd\u30fc\u30c8\u306f\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3067\u3042\u308b - Panda Noir\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":["JavaScript"],"type":"rich","height":"190","published":"2026-05-17 09:21:49","provider_name":"Hatena Blog"}