NeetCode #662LC-256Medium1-D Dynamic ProgrammingNC Algo100
← Back to All Problems

#662 · #256 · Paint House(粉刷房子)

📌 Problem Statement & Constraints

You are given an n x 3 matrix costs where costs[i][j] is the cost of painting house i with colour j (colours 0, 1, 2). Paint every house so that no two adjacent houses share a colour, minimising the total cost. Constraints: 1 <= n <= 100, 1 <= costs[i][j] <= 20.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!