<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sosodemonai</author_name>
  <author_url>https://blog.hatena.ne.jp/sosodemonai/</author_url>
  <blog_title>Neunomizuの日記</blog_title>
  <blog_url>https://propyon.hateblo.jp/</blog_url>
  <categories>
    <anon>leetcode</anon>
  </categories>
  <description>tags: leetcode 問題 何故かExploreだと名前が&quot;Search for a Range&quot;になっていますが, 同じ問題です Explore Problems アイデア 昇順に整列された配列のうち, targetと一致するものの始点と終点を求めろというもの. 対数時間で求めよという指定から二分探索を使うと考えられます. targetと一致する要素の数列の左端と右端を二分探索で求めれば対数時間で計算することが可能です 解法 新たに関数を用意します. これをbinsearchとして引数に右端から探索するか, 左端から探索するかを決めるフラグを入れます. このフラグがtrueのとき, …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpropyon.hateblo.jp%2Fentry%2F2020%2F02%2F08%2F155553&quot; title=&quot;# LeetCode Medium 34. Find First and Last Position of Element in Sorted Array - Neunomizuの日記&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>2020-02-08 15:55:53</published>
  <title># LeetCode Medium 34. Find First and Last Position of Element in Sorted Array</title>
  <type>rich</type>
  <url>https://propyon.hateblo.jp/entry/2020/02/08/155553</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
