能种多少花儿
class Solution(object):
def canPlaceFlowers(self, A, N):
"""
:type flowerbed: List[int]
:type n: int
:rtype: bool
"""
for i in range(len(A)):
if (not A[i] and (i == 0 or A[i-1] == 0)
and (i == len(A)-1 or A[i+1] == 0)):
N -= 1
A[i] = 1
return N <= 0