Skip to content

Commit 4884f70

Browse files
refactor 605
1 parent 9645327 commit 4884f70

File tree

1 file changed

+2
-1
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+2
-1
lines changed

src/main/java/com/fishercoder/solutions/_605.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ public boolean canPlaceFlowers(int[] flowerbed, int n) {
3939
for (int i = 1; i < len - 1; i++) {
4040
if (flowerbed[i] == 0 && flowerbed[i - 1] == 0 && flowerbed[i + 1] == 0) {
4141
n--;
42-
flowerbed[i] = 1;//modify the input, discuss this with interviwer, if not allowed, then have a copy of this input and modify copy
42+
//modify the input, discuss this with interviwer, if not allowed, then have a copy of this input and modify copy
43+
flowerbed[i] = 1;
4344
}
4445
if (n <= 0) {
4546
return true;

0 commit comments

Comments
 (0)