Paint House! Time : Space : 1234567891011121314int Solution::solve(vector<vector<int> > &A) { int r = 0, g = 0, b = 0; for(auto a : A) { int rr = min(g,b) + a[0]; int gg = min(r,b) + a[1]; int bb = min(r,g) + a[2]; r = rr; g = gg; b = bb; } return min({r,g,b});}