Question Bank

JavaScript Binary Array Plant Pots: Two Approaches Quiz

Difficulty: Hard

Decide whether N new plants can be potted into a binary array of pots with no two plants adjacent. Two approaches (greedy single pass, lookahead with neighbour check), plus capacity counting and input validation.