1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/寻找目标值 - 二维数组 [er-wei-shu-zu-zhong-de-cha-zhao-lcof].html

44 lines
1.1 KiB
HTML
Raw Normal View History

2023-12-09 18:53:53 +08:00
<p><code>m</code>*<code>n</code> 的二维数组 <code>plants</code> 记录了园林景观的植物排布情况,具有以下特性:</p>
<ul>
<li>每行中,每棵植物的右侧相邻植物不矮于该植物;</li>
<li>每列中,每棵植物的下侧相邻植物不矮于该植物。</li>
</ul>
<p>&nbsp;</p>
<p>请判断 <code>plants</code> 中是否存在目标高度值 <code>target</code></p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>plants = [[2,3,6,8],[4,5,8,9],[5,9,10,12]], target = 8
<strong>输出:</strong>true
</pre>
<p>&nbsp;</p>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>plants = [[1,3,5],[2,5,7]], target = 4
<strong>输出:</strong>false
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= n &lt;= 1000</code></li>
<li><code>0 &lt;= m &lt;= 1000</code></li>
</ul>
<p>注意:本题与主站 240 题相同:<a href="https://leetcode-cn.com/problems/search-a-2d-matrix-ii/" rel="noopener noreferrer" target="_blank">https://leetcode-cn.com/problems/search-a-2d-matrix-ii/</a></p>
<p>&nbsp;</p>