Skip to content

Commit fd232f8

Browse files
committed
❌ [605] EC
1 parent 9d02b16 commit fd232f8

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

605/my_solution.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @param {number[]} flowerbed
3+
* @param {number} n
4+
* @return {boolean}
5+
*/
6+
var canPlaceFlowers = function (flowerbed, n) {
7+
if (n === 0) return true;
8+
9+
let placeNeeded = 1;
10+
for (let i = 0; i < n; i++) {
11+
placeNeeded += 2;
12+
}
13+
14+
return (flowerbed.length - 2) >= placeNeeded;
15+
};

605/solution.js

Whitespace-only changes.

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
- [435. Non-overlapping Intervals](./435/)
8383
- [530. Minimum Absolute Difference in BST](./530/)
8484
- [572. Subtree of Another Tree](./572/)
85+
- [605. Can Place Flowers](./605/)
8586
- [647. Palindromic Substrings](./647/)
8687
- [771. Jewels and Stones](./771/)
8788
- [714. Best Time to Buy and Sell Stock with Transaction Fee](./714/)
@@ -154,7 +155,7 @@ Batch create:
154155
NOTE: JS IS HERE
155156
-->
156157
```ssh
157-
chapter=1431 && mkdir ./$chapter && touch ./$chapter/my_solution.js && touch ./$chapter/solution.js && alias x="node ./$chapter/my_solution.js"
158+
chapter=605 && mkdir ./$chapter && touch ./$chapter/my_solution.js && touch ./$chapter/solution.js && alias x="node ./$chapter/my_solution.js"
158159
```
159160
> then you can use `x` for quick debug.
160161

0 commit comments

Comments
 (0)