← All problemsSign in

Help Harvey

Harvey Specter has $N$ consecutive plots, each of 1 unit. These plots are denoted by either $1$ or $0$. $0$ means the plot is empty and $1$ means there is a house built on it. Harvey wants to build $K$ more houses. However, the houses must not be built on adjacent plots and there must be a difference of at least 1 plot between any two houses. Given $K$, find out if it is possible to build ex

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start