<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>yokoyantech</author_name>
  <author_url>https://blog.hatena.ne.jp/yokoyantech/</author_url>
  <blog_title>紙一重の積み重ね</blog_title>
  <blog_url>https://www.yokoyan.net/</blog_url>
  <categories>
    <anon>AtCoder</anon>
    <anon>ruby</anon>
  </categories>
  <description>はじめに AtCoderの過去問をA問題から穴埋め中です。 普通に解いてACだった問題を、もっと短くコード書けないかと思い、select使ったらWAだったのでメモします。 解いた問題 atcoder.jp 最初に書いたコード(AC) これでACだったんですが、モッサリしてるコードです。 無駄が多い。。 ls = gets.split.map(&amp;:to_i) if ls.uniq.size == 1 puts ls[0] else puts ls.select{|l| ls.count(l) == 1 } end リファクタ1回目(WA) 要素の数を2で割った余りが1の要素を出したらいいじゃない…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.yokoyan.net%2Fentry%2F2019%2F08%2F25%2F134543&quot; title=&quot;【AtCoder ABC027 A問題】selectとfindメソッドの動きの違いについて - 紙一重の積み重ね&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>https://cdn-ak.f.st-hatena.com/images/fotolife/y/yokoyantech/20190825/20190825134320.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-08-25 13:45:43</published>
  <title>【AtCoder ABC027 A問題】selectとfindメソッドの動きの違いについて</title>
  <type>rich</type>
  <url>https://www.yokoyan.net/entry/2019/08/25/134543</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
