<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Search on Python Exercises</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/categories/search/</link><description>Recent content in Search on Python Exercises</description><generator>Hugo</generator><language>fa-ir</language><lastBuildDate>Sat, 06 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://amirmahdikahdouii.github.io/Python-Exercises/categories/search/index.xml" rel="self" type="application/rss+xml"/><item><title>اولین و آخرین وقوع</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/083-first-last-occurrence/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/083-first-last-occurrence/</guid><description>&lt;p&gt;&lt;strong&gt;#083&lt;/strong&gt; · &lt;strong&gt;First Last Occurrence&lt;/strong&gt; · &lt;code&gt;search&lt;/code&gt; · &lt;code&gt;medium&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/083-first-last-occurrence/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="first-and-last-occurance"&gt;First and Last Occurance&lt;/h1&gt;
&lt;p&gt;توی این برنامه از شما میخوایم که یک لیست نامرتب از اعداد رو دریافت کنید، اون رو مرتب کنید و داخل لیست مرتب شده، شماره ایندکس اولین مقدار از عدد و آخرین مقدار از عدد رو خروجی بدید!&lt;/p&gt;
&lt;h2 id="input-1"&gt;Input-1:&lt;/h2&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;1 4 2 6 1 5 4 8 4 9 3 2 8 7 7 0 3 0 5 1 4 5
5
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="output-1"&gt;Output-1&lt;/h2&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[0, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 7, 7, 8, 8, 9, 5]
13
14
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>جستجوی بازه در لیست</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/081-search-sorted-range/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/081-search-sorted-range/</guid><description>&lt;p&gt;&lt;strong&gt;#081&lt;/strong&gt; · &lt;strong&gt;Search Sorted Range&lt;/strong&gt; · &lt;code&gt;search&lt;/code&gt; · &lt;code&gt;medium&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/081-search-sorted-range/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="search-range"&gt;Search Range&lt;/h1&gt;
&lt;p&gt;برنامه ای بنویسید که یک لیست نامرتب از اعداد را دریافت کند و آن را مرتب کند و در آن ایندکس شروع و ایندکس پایان عدد که در لیست اعداد پیدا شده را خروجی دهد.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ورودی:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;در خط اول ورودی یک لیست از اعداد که با فاصله از هم جدا شده اند به شما داده میشود.&lt;/p&gt;</description></item><item><title>دو جمع با بیشترین تفاضل</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/079-two-sum-max-diff/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/079-two-sum-max-diff/</guid><description>&lt;p&gt;&lt;strong&gt;#079&lt;/strong&gt; · &lt;strong&gt;Two Sum Max Diff&lt;/strong&gt; · &lt;code&gt;search&lt;/code&gt; · &lt;code&gt;medium&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/079-two-sum-max-diff/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="two-sum"&gt;Two Sum&lt;/h1&gt;
&lt;p&gt;برنامه ای بنویسید که یک لیست از اعداد را دریافت کند. سپس یک عدد دریافت کند و مشخص کند آیا در لیست داده شده از اعداد، دو عدد وجود دارند که مجموع آنها برابر با عدد داده شده باشد یا خیر.&lt;/p&gt;
&lt;p&gt;اگر وجود داشت آن دو عدد را خروجی دهید در غیر این صورت None خروجی داده شود.&lt;/p&gt;</description></item><item><title>مقایسه جستجوی باینری و خطی</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/082-binary-linear-search-compare/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/082-binary-linear-search-compare/</guid><description>&lt;p&gt;&lt;strong&gt;#082&lt;/strong&gt; · &lt;strong&gt;Binary Linear Search Compare&lt;/strong&gt; · &lt;code&gt;search&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/082-binary-linear-search-compare/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="binary-search-vs-linear-search"&gt;Binary Search vs Linear Search&lt;/h1&gt;
&lt;p&gt;توی این سوال، خواستم برای تفاوت درک پیاده سازی دو روش سرچ باینری و خطی در لیست های اعداد مرتب، و تعداد گام هایی که هر دو الگوریتم انجام دادن، برنامه رو پیاده سازی کنم که میتونید خودتون هم برای درک بهتر ببینید کد رو و خودتون پیاده اش کنید!&lt;/p&gt;</description></item><item><title>موقعیت درج در لیست</title><link>https://amirmahdikahdouii.github.io/Python-Exercises/problems/072-search-insert-position/</link><pubDate>Sat, 06 Jun 2026 00:00:00 +0000</pubDate><guid>https://amirmahdikahdouii.github.io/Python-Exercises/problems/072-search-insert-position/</guid><description>&lt;p&gt;&lt;strong&gt;#072&lt;/strong&gt; · &lt;strong&gt;Search Insert Position&lt;/strong&gt; · &lt;code&gt;search&lt;/code&gt; · &lt;code&gt;easy&lt;/code&gt; · &lt;code&gt;python&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Amirmahdikahdouii/Python-Exercises/blob/master/problems/072-search-insert-position/solution.py"&gt;مشاهده راه‌حل در GitHub&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h1 id="search-insert-algorithm"&gt;Search Insert Algorithm&lt;/h1&gt;
&lt;p&gt;توی این مسئله از شما میخوایم توی یک لیست از اعداد بگید که اگه این لیست اعداد به صورت صعودی مرتب بشن، عددی که در ادامه به شما خواهیم داد توی چه خونه ای از آرایه قرار خواهد گرفت.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ورودی:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;در خط اول ورودی به شما لیستی از اعداد داده میشود که با &amp;ldquo;,&amp;rdquo; از هم جدا شده اند.&lt;/p&gt;</description></item></channel></rss>