605 leetcode.com/problems/can-place-flowers/ 꽃을 심는데 반드시 꽃 사이사이에 한칸씩 공간이 있어야 한다. class Solution(object): def canPlaceFlowers(self, fb, n): i = 0 while i 0: if i == len(fb) -1 and fb[i-1] == 0 and fb[i] == 0: fb[i] = 1 n -= 1 break elif i < len(fb) -1 and fb[i] == 0 and fb[i+1] == 0: fb[i] = 1 n -= 1 i += 2 elif i < len(fb) -1 and fb[i] == 1 and fb[i+1] == 0: i += 2 else: i += 1 ..