Given an integer list flowerbed, each element is either n. Determine if n new flowers can be planted without violating the rule that no two flowers can be planted in adjacent plots. Return TRUE if it’s possible to plant all n flowers. Otherwise, return FALSE.
Constraints:
flowerbed.length
n flowerbed.length
flowerbed[i] is
There are no two adjacent flowers in the flowerbed.
Given an integer list flowerbed, each element is either n. Determine if n new flowers can be planted without violating the rule that no two flowers can be planted in adjacent plots. Return TRUE if it’s possible to plant all n flowers. Otherwise, return FALSE.
Constraints:
flowerbed.length
n flowerbed.length
flowerbed[i] is
There are no two adjacent flowers in the flowerbed.