#605 - Can Place Flowers
Given a flowerbed represented as an integer array flowerbed containing 0s (empty) and 1s (planted), and an integer n, return true if n new flowers can be planted without violating the no-adjacent-flowers rule (no two flowers in neighboring plots).
| Input | Output |
|---|---|
flowerbed = [1,0,0,0,1], n = 1 | true |
flowerbed = [1,0,0,0,1], n = 2 | false |
flowerbed = [0,0,1,0,0], n = 2 | true |