Skip to content

Commit cf171ac

Browse files
committed
Create readme : 0605-can-place-flowers
1 parent 26f24b2 commit cf171ac

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

0605-can-place-flowers/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<h2><a href="https://leetcode.com/problems/can-place-flowers">605. Can Place Flowers</a></h2><h3>Easy</h3><hr><p>You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in <strong>adjacent</strong> plots.</p>
2+
3+
<p>Given an integer array <code>flowerbed</code> containing <code>0</code>&#39;s and <code>1</code>&#39;s, where <code>0</code> means empty and <code>1</code> means not empty, and an integer <code>n</code>, return <code>true</code>&nbsp;<em>if</em> <code>n</code> <em>new flowers can be planted in the</em> <code>flowerbed</code> <em>without violating the no-adjacent-flowers rule and</em> <code>false</code> <em>otherwise</em>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
<pre><strong>Input:</strong> flowerbed = [1,0,0,0,1], n = 1
8+
<strong>Output:</strong> true
9+
</pre><p><strong class="example">Example 2:</strong></p>
10+
<pre><strong>Input:</strong> flowerbed = [1,0,0,0,1], n = 2
11+
<strong>Output:</strong> false
12+
</pre>
13+
<p>&nbsp;</p>
14+
<p><strong>Constraints:</strong></p>
15+
16+
<ul>
17+
<li><code>1 &lt;= flowerbed.length &lt;= 2 * 10<sup>4</sup></code></li>
18+
<li><code>flowerbed[i]</code> is <code>0</code> or <code>1</code>.</li>
19+
<li>There are no two adjacent flowers in <code>flowerbed</code>.</li>
20+
<li><code>0 &lt;= n &lt;= flowerbed.length</code></li>
21+
</ul>

0 commit comments

Comments
 (0)