Available question text
Given n houses and k paint colors with a cost matrix, choose a color for each house so no two adjacent houses share a color and the total painting cost is minimized. The challenge is to design an efficient DP that handles large k (avoid naive O(n·k²)), typically by carrying forward the best and second-best previous costs to achieve O(n·k) time.
Related questions
Continue with questions that share topics or the same question type.
- Paint House
Coding
- Paint House III
Coding
- Paint House IV
Coding
- House Robber
Coding · Array · Dynamic Programming
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
LinkedIn
Leetcode 265. Paint House II
Reported Sep 1, 2026 · 5 source reports
MID_LEVEL, SENIOR
Source snapshot: Nov 12, 2026
View source