输入字符串:
在 Python 中写出以下问题的解决方案:您有一个长的花床,其中一些地块被种植,有些则没有.然而,花朵不能种植在相邻的地块.给出一个包含 0 和 1 的整数数组花床,其中 0 表示空, 1 表示不空,以及一个整数 n,返回 true if n 新的花朵可以在花床中种植,而不会违反没有相邻花的规则,否则 false.
Here's one solution in Python:

```
def can_place_flowers(flowerbed, n):
    # Add dummy 0's to beginning and end to handle edge cases
    flowerbed = [0] + flowerbed + [0]
    
    i = 1
    count = 0
    while i < len(flowerbed) - 1:
        if flowerbed[i-1] == flowerbed[i] == flowerbed[i+1] == 0:
            flowerbed[i] = 1
            count += 1
        i += 1
        
    return count >= n
```

To use the function, you would pass in a list of 0's and 1's representing the flowerbed and an integer `n` representing the number of new flowers you want to plant. For example:

```
flowerbed = [1,0,0,0,1]
n = 1
print(can_place_flowers(flowerbed, n))  # Returns True
```