← Questions
Paint house: cheapest daily colors with no repeat on consecutive days
0
I was asked this
No reports yet. Sign in to say where you were asked it.
For the next n days a store sells blue, green and red shirts, and you get three cost arrays, one per color, giving each color's price on each day. You buy exactly one shirt every day, but you may not buy the same color on two consecutive days. Return the minimum total cost.
This is the classic "paint house" problem: explain the recurrence, then bring the extra space down to a constant.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
