<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>round-rand</author_name>
  <author_url>https://blog.hatena.ne.jp/round-rand/</author_url>
  <blog_title>ランドML</blog_title>
  <blog_url>https://ml-rand-note.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>和集合：| 積集合：&amp; 差集合：- 参考 和集合：| 「どちらかの配列に含まれる要素」を取得します。 重複がある場合は取り除かれます。 a = [1, 2, 3, 3] b = [3, 4, 5] p a | b #=&gt; [1, 2, 3, 4, 5] 積集合：&amp; 「両方の配列にある要素」を取得します。 a = [1, 2, 3, 3] b = [3, 4, 5] p a &amp; b #=&gt; [3] 差集合：- 「左側の配列に存在し、右側の配列には存在しない要素」を取得します。 a = [1, 2, 3, 3] b = [1, 3, 4] p a - b #=&gt; [2] 参考 docs.ruby-…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fml-rand-note.hatenablog.com%2Fentry%2Fruby%2Farray-union&quot; title=&quot;【Ruby】配列の和集合・積集合・差集合を求める方法 - ランドML&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-06-11 00:00:00</published>
  <title>【Ruby】配列の和集合・積集合・差集合を求める方法</title>
  <type>rich</type>
  <url>https://ml-rand-note.hatenablog.com/entry/ruby/array-union</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
