LinkedIn interview question

Flowerbed problem