mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 23:41:41 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,19 +1,23 @@
|
||||
<p>Write an efficient algorithm that searches for a value <code>target</code> in an <code>m x n</code> integer matrix <code>matrix</code>. This matrix has the following properties:</p>
|
||||
<p>You are given an <code>m x n</code> integer matrix <code>matrix</code> with the following two properties:</p>
|
||||
|
||||
<ul>
|
||||
<li>Integers in each row are sorted from left to right.</li>
|
||||
<li>Each row is sorted in non-decreasing order.</li>
|
||||
<li>The first integer of each row is greater than the last integer of the previous row.</li>
|
||||
</ul>
|
||||
|
||||
<p>Given an integer <code>target</code>, return <code>true</code> <em>if</em> <code>target</code> <em>is in</em> <code>matrix</code> <em>or</em> <code>false</code> <em>otherwise</em>.</p>
|
||||
|
||||
<p>You must write a solution in <code>O(log(m * n))</code> time complexity.</p>
|
||||
|
||||
<p> </p>
|
||||
<p><strong>Example 1:</strong></p>
|
||||
<p><strong class="example">Example 1:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/05/mat.jpg" style="width: 322px; height: 242px;" />
|
||||
<pre>
|
||||
<strong>Input:</strong> matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3
|
||||
<strong>Output:</strong> true
|
||||
</pre>
|
||||
|
||||
<p><strong>Example 2:</strong></p>
|
||||
<p><strong class="example">Example 2:</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/05/mat2.jpg" style="width: 322px; height: 242px;" />
|
||||
<pre>
|
||||
<strong>Input:</strong> matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 13
|
||||
|
Reference in New Issue
Block a user