<?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>LeetCode 74 on Jeanphilo Blog</title><link>https://shio-chan-dev.github.io/jeanblog/tags/leetcode-74/</link><description>Recent content in LeetCode 74 on Jeanphilo Blog</description><generator>Hugo -- 0.165.0</generator><language>en-us</language><lastBuildDate>Thu, 13 Aug 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://shio-chan-dev.github.io/jeanblog/tags/leetcode-74/index.xml" rel="self" type="application/rss+xml"/><item><title>LeetCode 74: Search a 2D Matrix</title><link>https://shio-chan-dev.github.io/jeanblog/alg/leetcode/binary-search/74-search-a-2d-matrix/</link><pubDate>Thu, 13 Aug 2026 00:00:00 +0000</pubDate><guid>https://shio-chan-dev.github.io/jeanblog/alg/leetcode/binary-search/74-search-a-2d-matrix/</guid><description>&lt;p&gt;You are given an &lt;code&gt;m x n&lt;/code&gt; integer matrix &lt;code&gt;matrix&lt;/code&gt; and an integer &lt;code&gt;target&lt;/code&gt;. Return &lt;code&gt;True&lt;/code&gt; if &lt;code&gt;target&lt;/code&gt; is in the matrix; otherwise, return &lt;code&gt;False&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The matrix satisfies two conditions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Every row is sorted in non-decreasing order.&lt;/li&gt;
&lt;li&gt;The first integer of each row is strictly greater than the last integer of the previous row.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The required time complexity is &lt;code&gt;O(log(m * n))&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For example, consider this matrix:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;1 3 5 7
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;10 11 16 20
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;23 30 34 60
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;When &lt;code&gt;target = 3&lt;/code&gt;, return &lt;code&gt;True&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;When &lt;code&gt;target = 13&lt;/code&gt;, return &lt;code&gt;False&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The constraints are:&lt;/p&gt;</description></item></channel></rss>